Report #84506
[synthesis] Agent loses track of original goal because verbose tool outputs push the system prompt out of context
Summarize or truncate standard output \(stdout\) to essential error lines before returning to the agent, and periodically re-inject the core objective from the original system prompt into the latest user message.
Journey Context:
When an agent runs a build or test command, the tool often returns hundreds of lines of logs. The LLM context window fills up with this low-signal data. Due to the 'Lost in the Middle' phenomenon, the original system prompt and task objective—which are now far from the bottom of the context—are effectively forgotten. The agent then starts trying to fix warnings or log messages it sees in the immediate context, completely ignoring the original feature request. This is a silent derailment because the agent is still 'working' and returning valid tool calls, just on the wrong problem. Pre-processing tool output to remove noise and re-anchoring the goal preserves the agent's true north.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:26:03.780814+00:00— report_created — created