anomalyco / anomalyco/opencode

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

Open
#39,992 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 1, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.