feat: support DeepSeek Responses and configurable timeout - #628
Merged
zijiren233 merged 4 commits intoAug 8, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the relay layer to better support OpenAI-compatible “Responses” streaming across providers (notably DeepSeek), introduces a channel-configurable buffering timeout for initial Responses stream events, and adds response-time monitoring. It also standardizes frontend builds to use Corepack + pnpm with lockfile enforcement.
Changes:
- Add configurable
responses_first_event_timeoutand wire it into the OpenAI Responses streaming handler (plus shared config schema exposure in OpenAI-compatible adaptors). - Add DeepSeek Responses support gated to
deepseek-v4-flash, including model metadata and tests. - Refine retry-round behavior in relay channel selection and record
resp_costin the monitor plugin, with expanded tests.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Dockerfile | Switch frontend build to corepack pnpm with --frozen-lockfile. |
| .github/workflows/release.yml | Align CI release build with Corepack + pnpm lockfile usage. |
| core/relay/plugin/monitor/monitor.go | Record response latency (resp_cost) after upstream response handling. |
| core/relay/plugin/monitor/monitor_test.go | Add tests validating resp_cost is recorded for success/error paths. |
| core/relay/adaptor/openai/config.go | Add responses_first_event_timeout config + exported schema/options loaders. |
| core/relay/adaptor/openai/config_test.go | Add tests for default/configured timeout and schema presence. |
| core/relay/adaptor/openai/response.go | Make initial Responses stream buffering timeout configurable via parameter. |
| core/relay/adaptor/openai/response_test.go | Refactor tests to avoid global timeout mutation; add config-driven timeout test. |
| core/relay/adaptor/openai/adaptor.go | Thread configured timeout into streaming Responses path with error wrapping. |
| core/relay/adaptor/qianfan/config.go | Add schema fields for responses_first_event_timeout and reasoning mapping. |
| core/relay/adaptor/deepseek/constants.go | Add deepseek-v4-flash model definition and limits/pricing. |
| core/relay/adaptor/deepseek/adaptor.go | Gate Responses support to deepseek-v4-flash; expose OpenAI config schema. |
| core/relay/adaptor/deepseek/adaptor_test.go | Add tests for Responses URL support, mode support gating, schema exposure. |
| core/relay/adaptor/doubao/main.go | Delegate Responses-family handling to embedded OpenAI adaptor; expose config schema. |
| core/relay/adaptor/openrouter/adaptor.go | Delegate default DoResponse to embedded OpenAI adaptor; expose config schema. |
| core/relay/adaptor/ali/adaptor.go | Load per-channel Responses streaming options and pass into OpenAI DoResponse. |
| core/relay/adaptor/azure/main.go | Expose OpenAI config schema in Azure adaptor metadata. |
| core/relay/adaptor/azure/main_test.go | Add test asserting OpenAI config schema is exposed. |
| core/relay/adaptor/azure2/main.go | Expose OpenAI config schema in Azure2 adaptor metadata. |
| core/relay/adaptor/ai360/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/baichuan/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/cloudflare/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/geminiopenai/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/groq/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/jina/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/lingyiwanwu/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/mistral/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/novita/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/sangforaicp/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/stepfun/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/tencent/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/xai/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/relay/adaptor/xunfei/adaptor.go | Expose OpenAI config schema in adaptor metadata. |
| core/controller/relay-controller.go | Simplify retry state tracking and permission-failure retry budgeting. |
| core/controller/relay-controller_test.go | Add/expand tests for retry lifecycle decisions and state updates. |
| core/controller/relay-channel.go | Implement retry “round” reset behavior and designated-channel pinning. |
| core/controller/relay-channel_test.go | Replace min-error-rate fallback tests with round-based retry selection tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.