Skip to content

Reconnecting error with deepseek api #58

Closed

Description

@ervin3

stream disconnected before completion: Provider error 400: {"error":{"message":"The reasoning_content in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}

Activity

  1. ervin3 commented on Jul 2, 2026

    @ervin3
    Author

    i think it might be subagents setup.

  2. Ingwannu commented on Jul 3, 2026

    @Ingwannu
    Owner

    Thanks for the report. This is very likely the DeepSeek V4 thinking-mode history rule surfacing during a tool/subagent continuation.

    DeepSeek V4 thinking mode returns reasoning_content on assistant messages and expects that field to be sent back on later multi-turn/tool-call requests. opencodex already had model-scoped support for replaying reasoning_content, but the built-in DeepSeek preset did not mark the V4 thinking models for that behavior, so a continuation turn could drop the field and DeepSeek would reject the request with the 400 you saw.

    I opened #61 to address this. The PR:

    • adds deepseek-v4-pro / deepseek-v4-flash to the DeepSeek preset
    • marks those V4 thinking models for reasoning_content history replay
    • maps Codex xhigh to DeepSeek max
    • keeps the older deepseek-reasoner behavior unchanged

    This should cover the subagent/tool-call path because the test now verifies an assistant message carrying both reasoning_content and tool_calls is replayed correctly.

  3. Ingwannu commented on Jul 3, 2026

    @Ingwannu
    Owner

    Merged the fix into dev via #61. Closing this for now; please reopen or comment if the DeepSeek reconnect error still reproduces after updating.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions