fix(captain): generate_pix returns success=false on real errors
When Inter integration fails ("Unit not configured for Pix", missing
certs, etc.), the tool was returning success=true with the error
message as formatted_message. The LLM interpreted that as success and
hallucinated "Pix generated" to the customer — and never triggered the
generate_reservation_link fallback.
Switch the rescue path from tool_feedback_response (success=true) to
error_response (success=false) so the Daniela scenario correctly falls
back to the reservation-link tool as documented in her prompt.
This commit is contained in:
parent
ee2aae3958
commit
6c9d12559d
@ -440,7 +440,10 @@ class Captain::Tools::GeneratePixTool < Captain::Tools::BaseTool
|
|||||||
mapped_error = map_pix_error_message(e)
|
mapped_error = map_pix_error_message(e)
|
||||||
return mapped_error if mapped_error.is_a?(Hash)
|
return mapped_error if mapped_error.is_a?(Hash)
|
||||||
|
|
||||||
tool_feedback_response(mapped_error)
|
# Erro real na geração do Pix deve voltar success: false pra LLM
|
||||||
|
# cair no fluxo de fallback (generate_reservation_link) em vez de
|
||||||
|
# alucinar que o Pix foi gerado.
|
||||||
|
error_response(mapped_error)
|
||||||
end
|
end
|
||||||
|
|
||||||
def map_pix_error_message(error)
|
def map_pix_error_message(error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user