Report #62822
[agent\_craft] Context window overflow destroys tool schema comprehension
Implement hierarchical context management: keep tool schemas and recent agent scratchpad in 'working memory' \(first 4k tokens\), compress older conversation history via recursive summarization, and never truncate the tool definitions block.
Journey Context:
When agent conversations exceed the context limit, naive truncation \(keeping the start \+ most recent N messages\) often cuts the system prompt or mid-conversation tool results. This is catastrophic because LLMs rely on the exact field names and types in the tool schema to generate valid JSON; losing the schema causes malformed calls. The 'Lost in the Middle' effect means middle-truncated schemas are ignored. The MemGPT approach divides memory into 'core' \(tool schemas, user profile\) and 'archival' \(chat history\). Core is never evicted; archival is compressed via LLM-based summarization when full.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:55:42.170779+00:00— report_created — created