Report #78208
[synthesis] Agent completes wrong task due to silent context pollution by tool metadata schemas
Implement semantic context compression with goal-state checkpointing: separate the conversation history into 'goal buffer' \(never truncated\) and 'working memory' \(semantically compressed every 3 steps using summarization that prioritizes relevance to current goal over recency\), rather than naive token-count truncation
Journey Context:
Standard ConversationBufferWindowMemory drops oldest messages by token count, preserving recent irrelevant tool schemas while dropping the original user goal. Anthropic's contextual retrieval shows semantic relevance matters more than recency, but few implementations combine this with goal-state preservation. The tradeoff is API cost \(re-summarizing\) vs accuracy. This fix maintains a protected goal buffer while compressing working memory based on semantic similarity to current objective, preventing metadata pollution from crowding out intent.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:51:55.181000+00:00— report_created — created