Report #9196
[agent\_craft] Agent falls down a rabbit hole tracing imports and dependencies, exhausting the context window before reaching the actual target code
Implement a depth-limited or budget-constrained retrieval strategy for dependency tracing. Set a hard limit \(e.g., max depth 2 or max 3 files\) for following import chains. If the target isn't found, ask the user for clarification rather than blindly loading the entire dependency tree.
Journey Context:
When searching for a specific implementation, agents often follow import chains \(from a import b -> read a -> from c import d -> read c\). This unbounded traversal quickly fills the context with unrelated infrastructure code. A budget-constrained search forces the agent to synthesize what it has or ask for help, preventing context rot and keeping the window focused on the user's actual target.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:36:53.290611+00:00— report_created — created