Report #5722
[agent\_craft] Agent drifts away from the original user instruction after a long chain of tool calls and sub-tasks
Pin the original user instruction and the high-level task plan at the top of the system prompt or in a dedicated 'objective' section of the context, and re-inject it after every major context compaction event.
Journey Context:
In long autonomous runs, the agent's context fills with intermediate tool outputs, error messages, and code snippets. The original instruction gets pushed further and further from the generation point, leading to 'goal drift' where the agent starts solving a related but different problem. Because summarization often drops the original instruction \(treating it as already processed\), it must be explicitly preserved and re-inserted to ensure every decision is evaluated against the actual user goal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:05:10.515163+00:00— report_created — created