Skip to content

[Bug]: API server gateway does not expose model reasoning/thinking blocks in /v1/chat/completions responses #37044

Closed

Description

@requiemforennui

Bug Description

Description

When using Hermes Agent as a gateway fronting Open WebUI, reasoning blocks generated by the underlying model are displayed correctly in the Hermes CLI/TUI but are missing from the API response sent to Open WebUI. This makes reasoning/thinking traces invisible to downstream clients that rely on the OpenAI-compatible chat completions endpoint.

Environment

Relevant Config

yaml

model:
default: stepfun/step-3.7-flash:free
provider: nous
base_url: https://inference-api.nousresearch.com/v1

agent:
reasoning_effort: medium

display.show_reasoning: true is also enabled in the Hermes config.

Steps to Reproduce

  1. Configure Hermes Agent with a reasoning-capable model and display.show_reasoning: true.
  2. Connect Open WebUI to the Hermes gateway endpoint.
  3. Send a prompt that elicits a visible reasoning chain (e.g., a multi-step problem).
  4. Observe that the Hermes TUI displays the reasoning block, but Open WebUI shows only the final assistant message with no thinking/reasoning section.

Expected Behavior

The reasoning/thinking content should be included in the streamed or final API response payload so that Open WebUI and other downstream consumers can render it.

Actual Behavior

The gateway’s API server adapter strips or omits the reasoning data from the outbound response. Only the final assistant content is delivered. This appears isolated to the API server path; other adapters (TUI, messaging) display reasoning correctly.

Affected Component

Configuration (config.yaml, .env, hermes setup), Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

No debug report available - all analysis is from the Open WebUI chat.

Operating System

Windows 10

Python Version

3.11.15

Hermes Version

0.15.1

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The API server adapter does not implement reasoning pass-through. There is no documented config toggle to enable it.

Proposed Fix (optional)

Add a config option such as gateway.expose_reasoning (default: false) and, when enabled, include the model’s reasoning content in the API server response stream. Alternatively, always include reasoning when the model returns it and display.show_reasoning is true.

Are you willing to submit a PR for this?

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

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/gatewayGateway runner, session dispatch, delivery
    on Jun 2, 2026
  2. temeddix commented on Jun 7, 2026

    @temeddix

    Having the same problem here. Reasoning block is really important for UX, and should be implemented.

  3. noperator commented on Jul 7, 2026

    @noperator

    Would like to see this fixed as well.

  4. jeremylanger commented on Aug 11, 2026

    @jeremylanger

    ➕1, would love to see this fixed!

  5. added
    area/streamingStreaming responses: gateway delivery, provider wire
    duplicateThis issue or pull request already exists
    on Aug 11, 2026
  6. alt-glitch commented on Aug 11, 2026

    @alt-glitch

    This was generated by AI during triage.

    Duplicate of #7556: both report that the API server does not honor display.show_reasoning for OpenAI-compatible chat-completions clients. The open reasoning-stream PRs remain related implementation candidates.

  7. jdieztec commented on Aug 27, 2026

    @jdieztec

    Same symptom here, with two data points that may help narrow it down.

    Setup

    • Hermes Agent v0.20.5
    • Backend: local llama.cpp server (OpenAI-compatible), not a cloud provider
    • Model: Qwen3.8-27B-GGUF:UD-Q4_K_XL
    • display.show_reasoning: true and display.reasoning_full: true
    • Clients tested: Hermes WebUI, Open WebUI

    1. Reproduces with a local llama.cpp backend

    Both existing reports use cloud providers (Nous Portal, DeepSeek). This also happens with a plain local llama.cpp server, which suggests the gap is in the API server's OpenAI-compat conversion rather than provider-specific.

    Non-streaming request straight to the API server:

    curl -s http://127.0.0.1:8642/v1/chat/completions \
      -H "Authorization: Bearer $API_SERVER_KEY" \
      -H 'Content-Type: application/json' \
      -d '{"model":"unsloth/Qwen3.8-27B-GGUF:UD-Q4_K_XL","stream":false,
           "messages":[{"role":"user","content":"Reason step by step: I have 7 watches and a 4-slot box. How many are left out?"}]}' \
      | jq '{reasoning: .choices[0].message.reasoning_content, content: .choices[0].message.content}'

    Result:

    {
      "reasoning": null,
      "content": "Step by step:\n\n1. You have 7 watches.\n..."
    }

    The same turn shows a full reasoning block in the dashboard (9119 native channel). So the model does produce it; it just doesn't survive the conversion to the OpenAI-compatible shape on 8642.

    2. Hermes WebUI duplicates the answer into the reasoning block

    Possibly a separate bug, but it shows up as a consequence of this one.

    With streaming.enabled: false (default), Hermes WebUI shows no reasoning block at all — consistent with the above.

    After setting streaming.enabled: true, a 💭 Reasoning block does appear — but its content is a verbatim copy of the assistant's answer, rendered twice: once inside the collapsible, once as the message body. Exported HTML:

    <details class="reasoning"><summary>💭 Reasoning</summary>
      <div class="reasoning-body"><p>Here's the result of my deep reflection: ...</p></div>
    </details>
    <p>Here's the result of my deep reflection: ...</p>

    It looks like the client falls back to filling the reasoning slot with content when reasoning_content is absent. Open WebUI, by contrast, shows nothing at all — which is at least not misleading.

    If it helps, I'm happy to run further tests against the local endpoint.

    BR, Jorge

  8. kshitijk4poor commented on Sep 24, 2026

    @kshitijk4poor

    Closing as fixed on current main (verified against f24a1d7): b957782.

    Already labelled duplicate of #7556, and the underlying gap is closed: api_server_openai_routes.py::_spawn_stream_agent wires reasoning_callback and the chat-completions SSE writer emits delta.reasoning_content (~L842); non-streaming adds message.reasoning_content (~L762). Commit b957782 (streaming) + 0a846a2 (non-streaming). Note: main streams reasoning unconditionally — display.platforms.api_server.show_reasoning gating (#7556) is not implemented; that belongs to #7556.

    If this still reproduces on the latest release, please reopen with the version and a log excerpt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/streamingStreaming responses: gateway delivery, provider wirecomp/gatewayGateway runner, session dispatch, deliveryduplicateThis issue or pull request already existstype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions