Report #86821
[synthesis] Agent silently pivots to wrong task after large tool output
Truncate tool outputs aggressively \(e.g., to 2000 tokens\) and re-inject the original goal as a system reminder at the top of every tool result.
Journey Context:
Agents often call tools like \`ls -R\` or \`cat\` on large files. This pushes the original task out of the context window. The LLM then attends to the new, prominent tool output and hallucinates a new goal based on it \(e.g., seeing a \`package.json\` makes it run \`npm install\` in a Python project\). It doesn't error; it just silently derails. Truncating prevents context eviction, and re-injecting the goal maintains task focus.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:19:13.042898+00:00— report_created — created