anomalyco / anomalyco/opencode
[FEATURE]: Route the built-in deepseek provider through the Responses API (native support for DeepSeek-V4-Flash-0731)
@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
@ai-sdk/openai3.0.84 never parsesresponse.reasoning_text.delta→ DeepSeek thinking text is silently dropped on the AI SDK path (model still reasons;reasoning_tokensare accounted). Only the native runtime (OPENCODE_EXPERIMENTAL_NATIVE_LLM=1+ provider IDopenai/anthropic/opencode*) displays it.- Native OpenAIResponses protocol rejects effort
max(OpenAI-spec-shaped;openai-options.ts:5-8filters it) — but DeepSeek supportsmax → maxand mapsxhigh/medium → high. deepseek-v4-proResponses support lands Aug 2026; onlydeepseek-v4-flashtoday. Responses API is stateless (store/previous_response_idignored).
Requested
- Responses route for the
deepseekprofile inpackages/llm(followingproviders/openai.ts:responses+chatselectors). sdk.responses()loader fordeepseekon the AI SDK path.- DeepSeek's official effort set
none/low/high/max(defaulthigh) — the mapping table is at https://api-docs.deepseek.com/zh-cn/guides/thinking_mode. - Keep
/v1/chat/completionsworking.
Related: #35732 (custom-provider Responses path), #39933 (chat-completions reasoning toggle), #39829 (opencode-go Responses endpoint).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.