Skip to content

[Bug] reasoning_content "invalid_request" on follow-up messages with OpenCodeZen DeepSeek-V4-Flash in thinking mode #41061

Closed as not planned

Description

@moXue-o

Description
When using OpenCodeZen's DeepSeek-V4-Flash with thinking mode enabled, sending a follow-up message within the same session intermittently fails with:
Error from provider (Console): Upstream request failed: [invalid_request_error]
The reasoning_content in the thinking mode must be passed back to the API.
The error breaks tool invocations and upstream requests, interrupting the conversation until the session is restarted.
Steps to reproduce

  1. Create a new session with OpenCodeZen's DeepSeek-V4-Flash with thinking mode enabled.
  2. First message works fine.
  3. Send a second (follow-up) message in the same session while reasoning output is present in the history.
  4. The error triggers and the conversation is interrupted.
    Expected vs actual
  • Expected: reasoning_content from history is passed back to the API correctly, or the client omits stale/empty reasoning fields.
  • Actual: Request rejected with invalid_request_error; upstream request fails.
    Environment
  • Provider: OpenCodeZen (configured via auth.json)
  • Model: DeepSeek-V4-Flash (thinking mode)
  • Error type: [invalid_request_error]
    Additional notes
  • Official DeepSeek API does NOT exhibit this issue with the same model — the problem appears specific to the OpenCodeZen gateway's handling of reasoning_content.
  • Restarting the session temporarily resolves it, but it reproduces again afterward.

Activity

  1. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. changed the title [-][Bug] reasoning_content must be passed back to the API on Console provider (thinking mode)[/-] [+][Bug] reasoning_content "invalid_request" on follow-up messages with OpenCodeZen DeepSeek-V4-Flash in thinking mode[/+] on Aug 7, 2026
  3. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions