Report #62051
[agent\_craft] Raw error strings confuse model or cause infinite retry loops
Define a structured error schema with fields: error\_type \(enum: 'timeout', 'not\_found', 'permission', 'invalid\_input'\), is\_retryable \(boolean\), suggested\_fix \(string\), and technical\_details \(string\). Map all tool exceptions to this schema. In system prompt: 'If is\_retryable is true, retry with suggested\_fix. If false, ask the user.' Never send raw stack traces to the LLM.
Journey Context:
Sending 'Error 404' or Python tracebacks caused models to either give up immediately or retry identically 5 times. By categorizing errors, the model can decide: timeouts -> retry, permission -> escalate to user, not\_found -> try alternate tool. This requires the execution layer to catch exceptions and normalize them to the schema. Raw stack traces are token-heavy and confuse the model about whether it should parse them or apologize.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T10:38:16.593707+00:00— report_created — created