#Exec doesnt work ollama?

1 messages · Page 1 of 1 (latest)

modern walrusBOT
#

That JSON is the model printing what an exec call would look like, not OpenClaw actually executing the exec tool.

When a tool really runs, OpenClaw receives a structured tool call from the provider (not plain text), executes it, and you’ll see the command output / tool result in the trace. With ollama/qwen2.5-coder:32b it’s pretty common that the model “roleplays tool use” and just emits {"name": "...", "arguments": ...} as text → nothing executes → no file.

Things to check (quick, in order):

  1. Version (important): run and paste:
openclaw --version
  1. Is the model actually tool-capable in OpenClaw? (if it’s not, tools won’t be exposed at all):
openclaw models status
openclaw models list --provider ollama
#
  1. Tool policy / sandboxing isn’t blocking you
  • If you have any tools.allow set, make sure it includes exec (or group:runtime).
  • If you enabled sandboxing, your command may be running in a sandbox workspace (so writing to ~/.openclaw/workspace/... may not hit what you expect).

Helpful CLI:

openclaw sandbox explain

Docs: https://docs.openclaw.ai/gateway/sandbox-vs-tool-policy-vs-elevated

  1. Retry with a simpler command + relative path
    Ask it to run:
#

If you paste openclaw --version + the output of openclaw models status (and tell me if sandboxing is on), I can tell you which of the above is the culprit in your setup.

modern walrusBOT
#

There isn’t a “secret best” Ollama model name I can guarantee here — tool calling for local OSS models is a moving target, and a lot of them will look like they’re calling tools but actually just print JSON.

In OpenClaw, the only reliable/authoritative way to answer “which Ollama models support tools” is:

  1. Use Ollama auto-discovery (recommended)
    Make sure you set OLLAMA_API_KEY (any value) and you do not have an explicit models.providers.ollama block in config. Then OpenClaw will query Ollama and only keep models that Ollama reports as tools-capable.
    Docs: https://docs.openclaw.ai/providers/ollama

  2. Then check what OpenClaw thinks is tool-capable on your box:

openclaw models list --provider ollama
# optionally:
openclaw models status

(or in chat: /model list)

If qwen2.5-coder:32b / devstral don’t appear in that list, they’re not advertising tool capability to OpenClaw → expect “JSON-as-text”.

#

If they do appear but still only print JSON, that’s the other common case: tool-capable on paper, not tool-reliable in practice (model just doesn’t follow the tool protocol consistently). In that case, the pragmatic fix is:

  • Use a hosted tool-reliable model for exec/browser work, and keep Ollama for casual chat (either via fallbacks or a separate “chat” agent).
  • Ask in #models for the current community-tested “Ollama models that actually execute tools” list (it changes fast, and people share what works this week). Also see: https://docs.openclaw.ai/concepts/models#model-discussions-community-notes

If you paste:

  • openclaw --version
  • openclaw models list --provider ollama
  • whether you have a custom models.providers.ollama in config

…I can tell you exactly whether you’re hitting “model not tool-capable”, “explicit config bypassed discovery”, or “tool-reliability” issues.