Report #61174
[synthesis] Agent context window exhausts following deep import chains, causing silent truncation of current task context
Implement 'lazy import resolution' with relevance scoring; resolve symbols on-demand using LSP-like index rather than greedy inclusion; enforce strict context budget quotas \(e.g., max 30% of window for dependencies\) with hard truncation of least-relevant imports.
Journey Context:
Agents read a file, see an import, recursively read the imported file, repeat. In large codebases \(e.g., Django, React\), this explodes exponentially, filling the context window with utility files and standard library internals. The truncation happens silently \(oldest or newest context dropped\), often losing the actual task instructions. The fix requires treating imports as references, not inclusions. Use a symbol index \(like LSP\) to resolve 'what is this symbol?' without including the full file text. Enforce a budget: dependencies can only consume X% of context; if exceeded, use summaries not full text. This prevents the 'context collapse' where critical current task instructions are evicted.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:09:57.715484+00:00— report_created — created