Skip to content

[Feature]: Pass Ollama think: false parameter when reasoning_effort: none is set for custom/Ollama providers #3191

@sir-mess

Description

@sir-mess

Problem or Use Case

When using Hermes Agent with an Ollama backend and reasoning_effort: none set in config, the think: false parameter is not passed to the Ollama API. This causes Qwen3.5 (and other thinking-capable models) to generate think blocks regardless of the reasoning setting, which produces empty think block errors that corrupt session state.

Proposed Solution

When reasoning_effort: none is configured and the provider is custom (Ollama), Hermes should pass "think": false in the request body to the Ollama API. This should apply to both /api/generate and /api/chat endpoints.

if provider == "custom" and reasoning_effort == "none":
    request_body["think"] = False

Alternatives Considered

The current reasoning_effort setting in Hermes maps correctly for cloud providers (OpenRouter, Nous Portal) but does not translate to Ollama's native think: false parameter when using a custom/Ollama endpoint. Workarounds attempted and confirmed ineffective:

/no_think in SOUL.md — ignored when sent as system prompt (Ollama only honors it in user turn)
PARAMETER stop "" in Modelfile — stop tokens don't intercept at the renderer level
SYSTEM prompt in Modelfile — inconsistent, not reliable

Feature Type

Configuration option

Scope

Small (single file, < 50 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions