Skip to content

Improve error recovery guidance in framework prompts#1502

Open
bluesky050 wants to merge 1 commit intoagent0ai:developmentfrom
bluesky050:improve-error-prompt-guidance
Open

Improve error recovery guidance in framework prompts#1502
bluesky050 wants to merge 1 commit intoagent0ai:developmentfrom
bluesky050:improve-error-prompt-guidance

Conversation

@bluesky050
Copy link
Copy Markdown

Summary

  • fw.msg_misformat.md: Replace the generic "You have misformatted your message. Follow system prompt instructions…" with 6 specific JSON formatting rules. This directly tells the agent which rule it likely violated (missing tool_args, string booleans, extra text outside JSON, wrong tool name) instead of pointing it back to re-read the entire system prompt.

  • fw.error.md: Add a 4-category error diagnosis checklist after the existing {{{error}}} payload. Without guidance, agents tend to retry the exact same action on error. The checklist prompts the agent to classify the error (parameter / environment / logic / timeout) and pick a category-appropriate recovery strategy, reducing stuck-in-retry loops.

Why these changes help

Both prompts are "second-chance" messages — the agent sees them only after something went wrong. The current prompts are minimally informative ("misformatted" / implicit "try again"), which gives the LLM little signal on what to change. Providing a short, structured checklist at the point of failure is cheaper and more reliable than hoping the agent re-derives the fix from the system prompt.

Test plan

  • Send an intentionally malformed tool call (e.g. tool_args as a string instead of an object) and verify the agent corrects the format on the next attempt
  • Trigger a tool error (e.g. call a non-existent tool name) and verify the agent classifies the error and switches approach rather than retrying identically
  • Run a normal multi-step task and confirm no regression in tool call format or error recovery behavior

fw.msg_misformat.md: Replace generic "misformatted" message with
6 specific JSON formatting rules. This directly addresses the most
common misformat patterns (missing tool_args, string booleans,
extra text outside JSON) instead of leaving the agent to re-read
the system prompt and guess which rule it violated.

fw.error.md: Add a 4-category error diagnosis checklist after the
existing error payload. Without guidance, agents tend to retry the
exact same action on error. The checklist prompts classification
(parameter/environment/logic/timeout) and a strategy switch per
category, reducing stuck-in-retry loops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants