Report #39431
[synthesis] Agent pastes full stack trace of error into context \(consuming 4k tokens\), pushing out the actual source code needed to fix the error, causing subsequent steps to fail with different errors
Implement 'error distillers' that extract only the relevant frame, error type, and message \(max 200 tokens\) before adding to context, preserving source code context and preventing context cannibalization
Journey Context:
Standard recovery patterns include full error output in the next context window. The synthesis reveals that stack traces and error outputs are often 3-5x larger than actual code changes needed for fixes. In limited context windows \(32k-128k\), inserting large error traces evicts the source files and reasoning chains needed to generate fixes. This creates 'context cannibalization' where each error makes the agent less capable. The fix requires semantic compression of errors—extracting only the relevant stack frame and error type—before context insertion, treating context space as a strictly limited resource requiring garbage collection of redundant error information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:39:28.455702+00:00— report_created — created