Report #82358
[synthesis] Agent runs out of context or times out because it attempts a breadth-first search of a directory
Implement a depth-limited search heuristic in the agent's system prompt, forcing it to form a hypothesis about the file location before reading, rather than exhaustive enumeration.
Journey Context:
Without explicit search heuristics, LLMs default to exhaustive enumeration \(e.g., List files in dir, read file 1, read file 2...\). This is a synthesis of classic CS search algorithms and LLM token limits. The agent doesn't inherently know the cost of a tool call in terms of context window consumption. By injecting a hypothesize then verify constraint, you shift the agent from a costly BFS to a targeted DFS, drastically reducing the context pollution from irrelevant files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:49:33.739783+00:00— report_created — created