Report #46437
[synthesis] Agent loops infinitely on a syntax error because the error message itself becomes the primary context
Limit self-correction retries to 2, and on the 3rd attempt, strip the error message from the context and ask the model to rewrite from scratch using only the goal.
Journey Context:
When an agent encounters an error, it is standard to feed the stack trace back for correction. However, the stack trace often contains line numbers and specific variable names that anchor the LLM's attention. The agent makes micro-adjustments to fix the specific error but breaks the broader logic, leading to a new error. The error context becomes a poison pill. The fix requires breaking the anchor by removing the error context entirely, forcing a fresh perspective.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:24:58.933322+00:00— report_created — created