openclaw - 💡(How to fix) Fix [Bug]: ollama-cloud provider (openai-completions) doesn't use native tool calling — model hallucinates exec outputs [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70736Fetched 2026-04-24 05:54:13
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

When using ollama-cloud as provider with nemotron-3-super:cloud (or any tool-capable model), OpenClaw sends the available tools as plain text inside the system prompt instead of using the native tools parameter in the API request. The model then cannot emit structured tool_calls, so exec (and other tools) are never actually invoked — the model hallucinates outputs that look like real executions.

Error Message

Gateway logs show `warn tools ... allowlist contains unknown entries

Root Cause

When using ollama-cloud as provider with nemotron-3-super:cloud (or any tool-capable model), OpenClaw sends the available tools as plain text inside the system prompt instead of using the native tools parameter in the API request. The model then cannot emit structured tool_calls, so exec (and other tools) are never actually invoked — the model hallucinates outputs that look like real executions.

Fix Action

Fix / Workaround

Model should emit a structured tool_calls payload targeting exec, OpenClaw should dispatch to the tool, and the real command output should be returned to the model and then to the user.

Code Example

{
  "message": {
    "role": "assistant",
    "tool_calls": [{
      "function": {
        "name": "run_bash",
        "arguments": {"command": "echo test > /tmp/openclaw_direct.txt"}
      }
    }]
  }
}

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When using ollama-cloud as provider with nemotron-3-super:cloud (or any tool-capable model), OpenClaw sends the available tools as plain text inside the system prompt instead of using the native tools parameter in the API request. The model then cannot emit structured tool_calls, so exec (and other tools) are never actually invoked — the model hallucinates outputs that look like real executions.

Steps to reproduce

  1. Configure ollama-cloud provider with nemotron-3-super:cloud
  2. Set it as the primary model for an agent on coding profile
  3. Send to the agent: ejecutá: whoami (or any shell command)
  4. Observe: agent replies with a formatted "execution" and a plausible output
  5. Verify on the server: no file was created, no process ran, no log entry in openclaw logs mentions exec being called

Expected behavior

Model should emit a structured tool_calls payload targeting exec, OpenClaw should dispatch to the tool, and the real command output should be returned to the model and then to the user.

Actual behavior

No tool_calls are emitted. The model generates a plausible-looking response including an invented timestamp/output.

OpenClaw version

2026.4.21 (f788c88)

Operating system

Ubuntu, Node v22.22.2

Install method

No response

Model

ollama-cloud/nemotron-3-super

Provider / routing chain

config: baseUrl: https://ollama.com/v1, api: openai-completions

Additional provider/model setup details

Test 1 — Direct curl to Ollama Cloud (native /api/chat endpoint): Returns structured tool_calls correctly:

{
  "message": {
    "role": "assistant",
    "tool_calls": [{
      "function": {
        "name": "run_bash",
        "arguments": {"command": "echo test > /tmp/openclaw_direct.txt"}
      }
    }]
  }
}

Test 2 — Direct curl to Ollama Cloud (openai-completions /v1/chat/completions): Also returns structured tool_calls correctly when tools: [...] is passed in the request body. Confirmed the model and endpoint both work.

Test 3 — mitmproxy capture of OpenClaw → Ollama Cloud traffic: Captured the actual request OpenClaw sends. The tools are listed as plain text in the system prompt:

And crucially, the request body does NOT include a top-level tools parameter with JSON schemas. So the model has no way to emit structured tool calls.

Test 4 — File-level verification: Asked agent to run echo "MARKER_$(date +%s%N)" > /tmp/test.txt && cat /tmp/test.txt. Agent responded with a formatted output and a marker value. File never existed on the filesystem. Confirmed hallucination.

Related notes

Gateway logs show warn tools ... allowlist contains unknown entries (gateway). These entries are shipped core tools but unavailable in the current runtime/provider/model/config. on startup — suggests the tool-registration path for this provider may have gaps.

Suggested fix

For providers using api: openai-completions, pass the agent's available tools as a structured tools: [...] array in the request body (OpenAI tool-calling format), not just as text in the system prompt. Ollama Cloud's /v1/chat/completions endpoint fully supports this.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Pass the agent's available tools as a structured tools: [...] array in the request body to enable the model to emit structured tool_calls.

Guidance

  • Verify that the tools parameter is correctly formatted and included in the request body for the openai-completions API.
  • Check the OpenClaw configuration to ensure that the tools array is properly set and passed to the Ollama Cloud API.
  • Test the fix by sending a request with the tools parameter and verifying that the model emits structured tool_calls and the tools are actually invoked.
  • Review the gateway logs to ensure that the warn tools ... allowlist contains unknown entries warning is resolved after applying the fix.

Example

{
  "prompt": "...",
  "tools": [
    {"name": "exec", "description": "..."},
    ...
  ]
}

Notes

The fix relies on the openai-completions API supporting the tools parameter, which is confirmed by the successful Test 2. The issue may be specific to the ollama-cloud provider and nemotron-3-super model.

Recommendation

Apply the suggested fix by passing the tools array in the request body to enable structured tool_calls and resolve the hallucination issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Model should emit a structured tool_calls payload targeting exec, OpenClaw should dispatch to the tool, and the real command output should be returned to the model and then to the user.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING