Report #3137
[agent\_craft] Agent drifts from original task objective during long execution loops
Pin the primary objective and success criteria at the top of the system prompt or a persistent context block, and mandate a check against this block before returning a final answer.
Journey Context:
In multi-step coding tasks \(refactor a module, write tests\), the agent gets bogged down in sub-tasks \(fixing a lint error\) and forgets the original goal \(refactor the API\). Keeping the goal in the system prompt isn't enough if the system prompt is long; it needs to be the first thing evaluated in the reasoning step. Tradeoff: consumes a few tokens but prevents infinite loops or incomplete tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T15:34:44.075472+00:00— report_created — created