fix(agent): stop fabricated success confirmations (#363)#372
Open
AlanAAG wants to merge 1 commit into
Open
Conversation
Collaborator
Author
|
Handles two specific error cases + general behaviour, if there are more specific issues where the agent wrongly confirms an action, please comment to be included in this pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CraftBot's agent was confirming actions it never performed: claiming it disabled an integration setting with no action call behind it, and claiming a Gmail "signature" was added when no signature capability exists anywhere in the codebase. Under user pushback, it escalated to inventing a new fabricated explanation on each retry instead of repeating the honest answer.
Root cause was three compounding gaps: no instruction to ground confirmation text in actual action evidence, an absolutist "never say you can't" prompt rule with no carve-out for genuine incapability, and stale/missing docs on what settings the agent can and can't actually change.
agent_core/core/prompts/context.py,action.py— add a non-negotiable honesty rule to every action-selection prompt: once a capability is genuinely checked and confirmed absent, say so plainly ("there's no way I can do that") instead of faking success; pushback from the user does not change the honest answer, so don't invent a new excuse on retry.app/data/action/send_message.py— same reinforcement on the schema description, at the exact point the confirmation text gets composed.agent_file_system/AGENT.md(+app/data/agent_file_system_template/AGENT.md) —set_requirementfor the first time (it was in use but entirely undocumented): check feasibility before locking a requirement in; only marksatisfiedwhen grounded in real action evidence; flip toviolatedimmediately if the user disputes it rather than silently retrying.app/config/*.jsonfiles (they aren't — most integrations have their own.credentials/<name>_config.json, or no runtime config at all).craftos_integrations/integrations/gmail/INTEGRATION.md,outlook/INTEGRATION.md— explicit "no signature feature exists, ever" note naming and banning the specific fabrications already observed in testing.tests/test_prompt_honesty_rules.py— presence-guard tests (6 cases) for both the always-injected framework-prompt layer and the integrations have their own.credentials/<name>_config.json, or no runtime config at all).craftos_integrations/integrations/gmail/INTEGRATION.md,outlook/INTEGRATION.md— explicit "no signature feature exists, ever" note naming and banning the specific fabrications already observed in testing.tests/test_prompt_honesty_rules.py— presence-guard tests (6 cases) for both the always-injected framework-prompt layer and the read-on-demand doc layer, so neither can silently regress.Deploy note: the framework prompt changes (
action.py,context.py,send_message.py) are loaded once at process start — a running CraftBot instance needs to be restarted to pick them up. TheAGENT.md/INTEGRATION.mddoc changes take effect immediately with no restart.Test plan
python3 -m pytest tests/test_prompt_honesty_rules.py -v— 6/6 passingpython3 -m pytest tests/ -q— 101 passed; 4 pre-existing failures intest_trigger_router_and_parking.pyconfirmed present on cleanmainbefore this change (unrelatedFakeLLM/prompt_namekwarg mismatch)Closes #363