Skip to content

reasoning_content 字段导致第三方中转 OpenAI格式 兼容 API 显示严重错乱 #1673

@1269699120

Description

@1269699120

Description

When using a third-party OpenAI-compatible API provider, the streaming response contains reasoning_content fields that cause severe display corruption in deepseek-tui. Each token is rendered as a separate "thinking" block instead of normal text output.

Steps to reproduce

  1. Configure deepseek-tui with an OpenAI-compatible third-party provider:
    provider = "openai"
    model = "deepseek-v4-flash"
    verify_ssl = false
    
    [providers.openai]
    base_url = "http://<third-party-api>/v1"
    api_key = "<third-party-key>"
    model = "deepseek-v4-flash"
  2. Set DEEPSEEK_ALLOW_INSECURE_HTTP=1 and launch deepseek-tui
  3. Send any message (e.g. "你好")

Expected behavior

The response text should be rendered normally as a continuous text block, like:

你好。有什么需要帮忙的?

Actual behavior

The response is broken into individual tokens, each preceded by a thinking done · 0.0s block:

thinking done · 0.0s
Full reasoning in Ctrl+O

thinking done · 0.0s
Full reasoning in Ctrl+O

thinking done · 0.0s
...

你好
。
有什么
需要
帮忙
的
?

The reasoning_content field in the streaming SSE chunks triggers the thinking/reasoning UI for every single chunk, even when the actual content is just normal text tokens.

Impact

This makes deepseek-tui completely unusable with any third-party OpenAI-compatible API that returns DeepSeek models' reasoning_content field. The display is so corrupted that the tool cannot be used for any practical work.

Workaround attempts:

  • Local proxy filtering reasoning_content from SSE chunks: causes compatibility issues with deepseek-tui's SSE client (no output or further format issues)
  • No workaround currently available

Environment

  • OS: Windows 11 Pro
  • DeepSeek CLI version: installed via npm (deepseek-tui package)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions