Report #42205
[agent\_craft] Agent fills context window to 100% capacity, causing generation to truncate mid-tool-call or mid-code-block
Dynamically calculate token count before injection. Reserve at least 1024-2048 tokens for the model's generation. If over budget, trigger compaction or summarization \*before\* the LLM call.
Journey Context:
A common failure mode is the agent loading a massive file, appending it to the prompt, and then the model tries to output the modified file but runs out of tokens. This results in truncated JSON or broken code blocks that fail to parse. You must budget for the output before constructing the input.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:18:45.322087+00:00— report_created — created