Skip to content

[FEATURE]: Route the built-in deepseek provider through the Responses API (native support for DeepSeek-V4-Flash-0731) #39992

Closed as not planned

Description

@sdmyzlp

Problem

DeepSeek officially supports the OpenAI Responses API for deepseek-v4-flash (live since 2026-07-31; docs: https://api-docs.deepseek.com/zh-cn/guides/responses_api), but opencode's built-in deepseek provider is hardwired to Chat Completions: models.dev pins it to @ai-sdk/openai-compatible, and the OpenAIResponses protocol (packages/llm/src/protocols/openai-responses.ts) is only wired for openai/xai/azure/github-copilot/amazon-bedrock.

Verified workaround

Define a custom provider in opencode.json whose ID is a responses-routed built-in (e.g. meta) with @ai-sdk/openai + baseURL: https://api.deepseek.com/v1. Requests then hit POST /v1/responses with reasoning: {effort} and KV-cache hits (verified via wire capture). Drawbacks: wrong effort tiers, no reasoning_options in config models, unrelated catalog models.

Known gaps

  1. @ai-sdk/openai 3.0.84 never parses response.reasoning_text.delta → DeepSeek thinking text is silently dropped on the AI SDK path (model still reasons; reasoning_tokens are accounted). Only the native runtime (OPENCODE_EXPERIMENTAL_NATIVE_LLM=1 + provider ID openai/anthropic/opencode*) displays it.
  2. Native OpenAIResponses protocol rejects effort max (OpenAI-spec-shaped; openai-options.ts:5-8 filters it) — but DeepSeek supports max → max and maps xhigh/medium → high.
  3. deepseek-v4-pro Responses support lands Aug 2026; only deepseek-v4-flash today. Responses API is stateless (store/previous_response_id ignored).

Requested

  1. Responses route for the deepseek profile in packages/llm (following providers/openai.ts: responses + chat selectors).
  2. sdk.responses() loader for deepseek on the AI SDK path.
  3. DeepSeek's official effort set none/low/high/max (default high) — the mapping table is at https://api-docs.deepseek.com/zh-cn/guides/thinking_mode.
  4. Keep /v1/chat/completions working.

Related: #35732 (custom-provider Responses path), #39933 (chat-completions reasoning toggle), #39829 (opencode-go Responses endpoint).

Activity

  1. github-actions commented on Aug 1, 2026

    @github-actions
    Contributor

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

  2. reopened this on Aug 1, 2026
  3. github-actions commented on Oct 1, 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