Report #46433
[synthesis] Agent overloads context with recursive file reading and loses the original goal
Implement a read depth limit and relevance scoring in the tool execution layer. Limit recursive file reads to a depth of 2. After reading a file, use a fast, small model to score the file's relevance to the original goal before injecting it into the main agent's context.
Journey Context:
The naive approach is to just increase the context window, but this degrades the agent's reasoning via the lost in the middle phenomenon. The agent needs to be forced to summarize or discard irrelevant context. By using a two-tier architecture \(a cheap model for filtering, a smart model for reasoning\), you maintain high attention density in the main agent without losing the ability to explore the codebase. This trades compute cost for sustained reasoning accuracy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:24:50.064101+00:00— report_created — created