Repository navigation
Ollama tool-calling loop does not complete for query/chat on v0.4.5 and v0.5.0-rc1 #205
Description
Activity
Additional note: also reproducible on the latest stable v0.4.5
This is not limited to the
v0.5.0-rc1release candidate.The same query/tool-loop failure was reproduced on the latest stable
v0.4.5with the same local Ollama setup and the same type of indexed KB. The observed symptoms were the same: raw tool-call JSON,{}, empty output, or a timeout instead of a final grounded answer.The
v0.5.0-rc1test was performed to check whether the newer agent/configuration changes fixed the issue. It did not. Please therefore treat this as affecting both:v0.4.5(latest stable release);v0.5.0-rc1(release candidate).
The
parallel_tool_calls/litellm.drop_paramsissue is related but not sufficient to resolve the complete tool-calling loop failure.- changed the title
[-]Ollama tool-calling loop does not complete for query/chat on v0.5.0-rc1[/-][+]Ollama tool-calling loop does not complete for query/chat on v0.4.5 and v0.5.0-rc1[/+]on Jul 24, 2026 Additional test: upgrading
openai-agentsto 0.18.3 does not fix the issueI repeated the test after upgrading the runtime from
openai-agents==0.17.3to the latest PyPI release available at the time of testing,openai-agents==0.18.3(which also installedopenai==2.48.0).For a clean run, the OpenKB container was recreated, stale query processes were stopped, and the local Ollama endpoint was verified from inside the container with HTTP 200. The test used OpenKB
v0.5.0-rc1, the same indexed KB, the same question, and the same configuration:api_base: http://ollama-host:11434 parallel_tool_calls: false litellm: drop_params: true
The endpoint above is a placeholder; no private network address or credential is included here.
The query was run sequentially against all locally available models:
Model Result with openai-agents==0.18.3llama3.1:8b-instruct-q8_0raw {"name": "read_index"}; no final answerqwen3.5:9bempty output gemma4:12btimeout after 150 seconds deepseek-r1:14b{"error": "File not found"}qwen2.5-coder:14brefusal/incomplete response instead of a grounded answer qwen3:14b{}llama3.2:1braw function-call JSON instead of a final answer Therefore, upgrading
openai-agentsfrom0.17.3to0.18.3had no material effect on the issue. The failure still appears to be in the end-to-end tool-calling loop between OpenKB, the Agents SDK, LiteLLM, and Ollama rather than being fixed by the Agents SDK version upgrade.Additional regression test (2026-07-29)
Environment:
- OpenKB
v0.5.0-rc1 - LiteLLM
1.94.0 openai-agents0.19.1- OpenAI SDK
2.49.0 - Ollama
0.32.5
All tests were run automatically and non-interactively in disposable containers using a synthetic KB.
Model OpenKB query result qwen2.5-coder:14bExit code 0; returned a responsefield; output containedtool_calls: [].deepseek-r1:14bExit code 0; returned {"error":"No such file or directory"}.qwen3.5:397b-cloudExit code 0; returned one read_filetool call; no final answer followed.The tests produced different query behaviors across models. The dependency versions and model-specific results are reported above.
- OpenKB
Summary
openkb addworks with local Ollama models, butopenkb querydoes not reliably complete the tool-calling loop. This remains reproducible on OpenKB v0.5.0-rc1, even with thelitellm.drop_paramsconfiguration introduced for Ollama compatibility.The models can emit tool calls, but the CLI either:
{};Environment
v0.5.0-rc1openai-agents==0.17.3No cloud API, private endpoint, API key, token, or other credential is required to reproduce the local-backend behavior.
Configuration
The KB configuration was equivalent to:
The hostname above is intentionally a placeholder. The real endpoint is private and is not part of this report.
Reproduction
Observed result with
llama3.1:8b-instruct-q8_0The CLI returned raw JSON similar to:
{ "reqId": "<redacted>", "message": "<a requested wiki path was not found>", "toolCalls": [ { "id": "<redacted>", "type": "function", "name": "read_file", "arguments": {"path": "summaries/index.md"} } ] }The tool call was not followed by a normal final answer.
The same model was also tested through the non-streaming
Runner.runpath. In that path it attempted to call a tool namedsearch_strategy, which was not one of the tools registered by OpenKB:Additional local-model results
Using the same KB, question, and OpenKB
v0.5.0-rc1CLI:llama3.1:8b-instruct-q8_0qwen3:14b{}qwen3.5:9bgemma4:12bdeepseek-r1:14b{}qwen2.5-coder:14bindex.mdwas unavailablellama3.2:1bopenkb addhad previously completed successfully on the same type of KB, including document summaries. The failure is specific to the query/chat agent path and tool-loop completion, not basic LiteLLM connectivity.Expected behavior
For an Ollama-compatible model that returns a valid structured tool call, OpenKB should:
If a model returns an unsupported or malformed tool call, OpenKB should report a clear actionable error rather than emitting raw JSON or returning
{}.Investigation notes
litellm:config block #138 address theparallel_tool_callsparameter rejected by Ollama. Settingparallel_tool_calls: falseandlitellm.drop_params: trueavoids that specific parameter error, but does not solve this issue.Runner.run_streamed(...)for the streaming path.Request
Could the maintainers please confirm:
query/chat;A small regression test covering one structured Ollama tool call, tool execution, and a final answer would help prevent this from recurring.