Skip to content

OpenClaw discards Ollama reasoning field — model output silently lost #247

@kakuteki

Description

@kakuteki

Description

When OpenClaw sends a chat completion request to an Ollama reasoning model (e.g. nemotron-3-nano:30b), the model returns its output in the reasoning field of the response, not in content. OpenClaw only reads content, so the actual model output is silently thrown away.

This is the root cause behind #246 (blank agent responses with Ollama).

The problem

Ollama's OpenAI-compatible API returns reasoning model output like this:

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "",
      "reasoning": "Hello! I'm happy to help. What would you like to know?"
    }
  }]
}

The model did produce a response. It's sitting right there in reasoning. But OpenClaw reads content, gets an empty string, and renders a blank bubble in the dashboard.

This affects every reasoning model served through Ollama — not just Nemotron Nano. Qwen3, DeepSeek-R1, and any future reasoning model will hit the same issue.

What should happen

Two things need to happen (ideally both):

1. NemoClaw should tell Ollama to skip reasoning when it's not needed

Ollama respects reasoning_effort: "none" (or think: false in the native API). When this is set, the model writes directly into content and the response works as expected:

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Hello! I'm happy to help. What would you like to know?"
    }
  }]
}

The Ollama provider configuration in NemoClaw should send this parameter by default for agent chat, since the reasoning chain is not surfaced to the user anyway.

2. OpenClaw should not silently discard non-empty reasoning when content is empty

Even if the provider misconfigures the model, a non-empty reasoning field with an empty content field is a clear signal that the output ended up in the wrong place. OpenClaw should fall back to reasoning as display text rather than showing nothing.

Affected components

  • NemoClaw: Ollama provider setup (openshell provider create) — does not pass reasoning-related parameters
  • OpenClaw: Chat completion response parsing — ignores reasoning field entirely

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: inferenceInference routing, serving, model selection, or outputsarea: local-modelsLocal model providers, downloads, launch, or connectivityarea: providersInference provider integrations and provider behaviorprovider: ollamaOllama local model provider behavior
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions