Endless Web-Search Loop
- Dominant language
- TypeScript
- Stars
- 979
- Forks
- 132
- Avg merge
- 9h 23m
- Merged PRs (30d)
- 8
Description
## Describe the bug
When using Agentic Chat / Chat Assistant to research a topic, the LLM enters an endless web-search loop — it repeatedly calls the web search tool instead of stopping to answer. This happens even when the prompt explicitly instructs it to use no more than 5 sources. There does not appear to be any user-facing setting to cap the number of tool calls/searches per turn, and no automatic loop/iteration limit kicks in to stop it. Proceeding
## To Reproduce
Steps to reproduce the behavior:
1. Open AI Playground and select the Agentic Chat / Chat Assistant preset with web search tool enabled, using Qwen3.5-9B via OpenVINO
2. Enter a research-style prompt: Research [topic] do not use more than 5 sources.
3. Observe the chat as it runs
4. The model repeatedly invokes the web search tool well past 5 calls and never returns a final answer — session must be manually stopped.
5. Any subsequent prompts in the session fail displaying an error: HTTP 400: {"error":"Mediapipe execution failed. MP status - INVALID_ARGUMENT: CalculatorGraph::Run() failed: \nCalculator::Process() for node \"LLMExecutor\" failed: Failed to apply chat template. The model either does not have chat template or has an invalid one."}. Possible chat history corruption by the aborted tool call?
## Expected behavior
The LLM should either respect the stated source limit, or (failing that) the app should enforce a hard cap on tool-call iterations per turn so a single agentic session can't loop indefinitely.
## Screenshots
## Environment (please complete the following information):
- OS: Windows 11
- GPU: Intel Arc Pro B50
- CPU: i5-13400
- Version: 3.2.0 beta
- Backend: OpenVINO
- Model: Qwen3.5-9B
Contributor guide
Research direction
The issue names no implementation files or tests. Start by reproducing the Agentic Chat or Chat Assistant flow in AI Playground with web search enabled, using Qwen3.5-9B through OpenVINO, then trace the tool-call loop and the failed session state after stopping it. Done means a turn cannot search indefinitely and later prompts remain usable after a loop is stopped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100