Report #16605
[agent\_craft] Agent drifts from original goal during long multi-step execution
Maintain a 'goal state' object at the very top of the system prompt or first user message, and re-inject it as a prefix to the LLM call every 3-5 steps, explicitly asking the agent to verify alignment.
Journey Context:
In long planning/execution loops, the agent gets distracted by intermediate errors \(e.g., fixing a lint error leads to a rabbit hole\). The original task is buried. Repeating the goal forces the attention mechanism back to the primary objective. Tradeoff: consumes tokens, but prevents costly infinite loops and off-topic exploration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:10:46.637548+00:00— report_created — created