ask-agentic-loop-is-bounded
IN premise
The tool-call loop in `ask()` has a maximum iteration count; an LLM that perpetually requests more searches is terminated and the raw response is returned.
Summary
When the system asks an LLM a question and lets it use tools like search, there is a hard cap on how many times it can loop back for more information. If the model keeps requesting additional searches without settling on an answer, the loop cuts it off and returns whatever it has so far. This prevents runaway costs and hangs from an indecisive model.
Dependents
These beliefs depend on this one:
- ask-is-fault-tolerant-and-bounded — The ask module is fault-tolerant (always returns a string, catches LLM failures, falls back to raw FTS5 search) and execution-bounded (tool loop capped at 3 iterations), ensuring reliable bounded knowledge retrieval regardless of LLM availability.
Details
| Source | entries/2026/04/29/tests-test_ask.md |