chore: adds deepseek to provider harness api tests - #5208
Conversation
📝 WalkthroughWalkthroughDeepSeek provider-harness coverage now spans multiple endpoint formats, streaming, reasoning effort, multi-turn conversations, tool calling, provider variants, and Anthropic-compatible migration scenarios. ChangesDeepSeek provider harness
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Harness
participant MigrationEndpoint
participant DeepSeek
Harness->>MigrationEndpoint: Send chat-completions or Responses request
MigrationEndpoint->>DeepSeek: Route request to DeepSeek
DeepSeek-->>MigrationEndpoint: Return completion, stream, or tool calls
MigrationEndpoint-->>Harness: Return migrated response
Harness->>Harness: Assert content, finish_reason, output_text, or tool_calls
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
39fa3f2 to
2d5cfe3
Compare
5750e73 to
1d8bd59
Compare
2d5cfe3 to
7455a0a
Compare
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (10): Last reviewed commit: "chore: adds deepseek to provider harness..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/api/collections/provider-harness.json (1)
40634-40683: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMulti-tool-call regression test is flaky and can crash instead of failing cleanly.
Two issues in this new "multiple tool calls" assertion, which is the key regression check for the PR's DeepSeek multi-tool-call fix:
- The prompt doesn't force
tool_choice, so the model may legitimately answer with 0 or 1 tool calls, making the>= 2assertion nondeterministic/flaky.var msg = pm.response.json().choices[0].message;is unguarded — ifchoices/choices[0]/messageis ever absent, this throws a raw TypeError instead of a clean assertion failure, unlike the defensiveif (j.choices && j.choices[0] && j.choices[0].message ...)pattern used by equivalent function-calling checks elsewhere in this file (e.g. the Cross-Cut Round 6/24 function-calling matrices).🐛 Proposed fix
"if ([401, 403, 429, 500, 502, 503, 504].indexOf(pm.response.code) !== -1) { return; }", "pm.test('deepseek multiple tool calls: 2xx', function () {", " pm.expect(pm.response.code, 'failed: ' + pm.response.text()).to.be.below(400);", "});", "if (pm.response.code >= 400) { return; }", - "var msg = pm.response.json().choices[0].message;", + "var j = pm.response.json();", + "var msg = j.choices && j.choices[0] && j.choices[0].message;", "pm.test('deepseek multiple tool calls: both tools called in a single turn', function () {", + " pm.expect(msg, 'no message in response: ' + pm.response.text()).to.exist;", " pm.expect(msg.tool_calls, 'no tool_calls: ' + pm.response.text()).to.be.an('array');", " pm.expect(msg.tool_calls.length, 'expected at least 2 tool calls: ' + pm.response.text()).to.be.at.least(2);", " var names = msg.tool_calls.map(function (tc) { return tc.function.name; });", " pm.expect(names).to.include('get_weather');", " pm.expect(names).to.include('calculate');", "});"And to reduce the risk of the model answering with fewer than 2 tool calls, consider forcing tool use in the request body, e.g.
"tool_choice": "required"(or"auto"with a stronger prompt ifrequiredisn't supported for this endpoint shape).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/api/collections/provider-harness.json` around lines 40634 - 40683, Make the DeepSeek multi-tool-call test deterministic by adding the supported required tool-choice setting to the request body, and update the test script to parse the response defensively before accessing choices[0].message. Ensure missing response structure produces a clean assertion failure, while preserving the existing checks that both get_weather and calculate appear in at least two tool calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/e2e/api/collections/provider-harness.json`:
- Around line 40634-40683: Make the DeepSeek multi-tool-call test deterministic
by adding the supported required tool-choice setting to the request body, and
update the test script to parse the response defensively before accessing
choices[0].message. Ensure missing response structure produces a clean assertion
failure, while preserving the existing checks that both get_weather and
calculate appear in at least two tool calls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 46ba17de-aa57-4f2c-aa2a-dda4789c32b2
📒 Files selected for processing (1)
tests/e2e/api/collections/provider-harness.json
7455a0a to
7d7238a
Compare
1d8bd59 to
5c27b1f
Compare
7d7238a to
2eac7a9
Compare
14fb8ba to
fe9f8fd
Compare
2eac7a9 to
8414c0a
Compare
fe9f8fd to
4a653a6
Compare
4a653a6 to
6f9ea9a
Compare
2e6576d to
700566a
Compare
700566a to
609bfb6
Compare
6f9ea9a to
2e2968f
Compare
609bfb6 to
7d5a1a5
Compare
2e2968f to
44d1516
Compare
7d5a1a5 to
d1d1779
Compare
44d1516 to
ca077b2
Compare
ca077b2 to
b1819f4
Compare
Merge activity
|
The base branch was changed.
## Summary
Adds DeepSeek provider coverage to the E2E provider harness test collection, including a new dedicated "DeepSeek Anthropic-Compatible Migration" test section that pins the behavior of DeepSeek's routing through the Anthropic-compatible endpoint (`/anthropic/v1/messages`) instead of the OpenAI-compatible `/chat/completions` path.
## Changes
- Added `deepseek/deepseek-v4-flash` and `deepseek/deepseek-v4-pro` entries across all existing harness sections: basic chat completions, streaming, Responses API, OpenAI-passthrough, Anthropic-passthrough, function calling, and reasoning effort.
- Added a new "DeepSeek Features" folder in the provider-specific section covering function calling, SSE streaming, `reasoning_effort: max` with `deepseek-v4-pro`, and multi-turn system message conversations.
- Added a new top-level section **"25. DeepSeek Anthropic-Compatible Migration"** with four pinned test cases:
- Non-streaming chat completions through the new Anthropic-compatible route, asserting a non-empty content response.
- Streaming chat completions, asserting `finish_reason` is reached and content accumulates across deltas.
- Multiple tool calls in a single turn (`get_weather` + `calculate`), asserting both tool calls are returned — a scenario previously broken on the OpenAI-compatible path.
- Native `/v1/responses` route (no chat-completion fallback), asserting a `message` output item with non-empty `output_text`.
- Reordered the function-calling section to place `deepseek/deepseek-v4-flash` after `gemini/gemini-2.5-flash`, and added `deepseek/deepseek-v4-flash` to the streaming section.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs
## How to test
Import `tests/e2e/api/collections/provider-harness.json` into Postman or run via Newman against a live gateway instance with a valid DeepSeek API key configured.
```sh
newman run tests/e2e/api/collections/provider-harness.json \
--env-var baseUrl=http://localhost:8080 \
--folder "DeepSeek Features" \
--folder "25. DeepSeek Anthropic-Compatible Migration"
```
Expected outcomes:
- All non-streaming requests return HTTP 2xx with non-empty `choices[0].message.content`.
- Streaming requests produce SSE chunks that accumulate content and include a `finish_reason`.
- The multiple-tool-call request returns at least two `tool_calls` entries naming `get_weather` and `calculate`.
- The native Responses API request returns an output item of type `message` containing non-empty `output_text`.
## Breaking changes
- [ ] Yes
- [x] No
## Related issues
## Security considerations
No new secrets or auth mechanisms introduced. DeepSeek API key handling follows the existing provider credential pattern.
## Checklist
- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
## Summary
Adds DeepSeek provider coverage to the E2E provider harness test collection, including a new dedicated "DeepSeek Anthropic-Compatible Migration" test section that pins the behavior of DeepSeek's routing through the Anthropic-compatible endpoint (`/anthropic/v1/messages`) instead of the OpenAI-compatible `/chat/completions` path.
## Changes
- Added `deepseek/deepseek-v4-flash` and `deepseek/deepseek-v4-pro` entries across all existing harness sections: basic chat completions, streaming, Responses API, OpenAI-passthrough, Anthropic-passthrough, function calling, and reasoning effort.
- Added a new "DeepSeek Features" folder in the provider-specific section covering function calling, SSE streaming, `reasoning_effort: max` with `deepseek-v4-pro`, and multi-turn system message conversations.
- Added a new top-level section **"25. DeepSeek Anthropic-Compatible Migration"** with four pinned test cases:
- Non-streaming chat completions through the new Anthropic-compatible route, asserting a non-empty content response.
- Streaming chat completions, asserting `finish_reason` is reached and content accumulates across deltas.
- Multiple tool calls in a single turn (`get_weather` + `calculate`), asserting both tool calls are returned — a scenario previously broken on the OpenAI-compatible path.
- Native `/v1/responses` route (no chat-completion fallback), asserting a `message` output item with non-empty `output_text`.
- Reordered the function-calling section to place `deepseek/deepseek-v4-flash` after `gemini/gemini-2.5-flash`, and added `deepseek/deepseek-v4-flash` to the streaming section.
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs
## How to test
Import `tests/e2e/api/collections/provider-harness.json` into Postman or run via Newman against a live gateway instance with a valid DeepSeek API key configured.
```sh
newman run tests/e2e/api/collections/provider-harness.json \
--env-var baseUrl=http://localhost:8080 \
--folder "DeepSeek Features" \
--folder "25. DeepSeek Anthropic-Compatible Migration"
```
Expected outcomes:
- All non-streaming requests return HTTP 2xx with non-empty `choices[0].message.content`.
- Streaming requests produce SSE chunks that accumulate content and include a `finish_reason`.
- The multiple-tool-call request returns at least two `tool_calls` entries naming `get_weather` and `calculate`.
- The native Responses API request returns an output item of type `message` containing non-empty `output_text`.
## Breaking changes
- [ ] Yes
- [x] No
## Related issues
## Security considerations
No new secrets or auth mechanisms introduced. DeepSeek API key handling follows the existing provider credential pattern.
## Checklist
- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

Summary
Adds DeepSeek provider coverage to the E2E provider harness test collection, including a new dedicated "DeepSeek Anthropic-Compatible Migration" test section that pins the behavior of DeepSeek's routing through the Anthropic-compatible endpoint (
/anthropic/v1/messages) instead of the OpenAI-compatible/chat/completionspath.Changes
deepseek/deepseek-v4-flashanddeepseek/deepseek-v4-proentries across all existing harness sections: basic chat completions, streaming, Responses API, OpenAI-passthrough, Anthropic-passthrough, function calling, and reasoning effort.reasoning_effort: maxwithdeepseek-v4-pro, and multi-turn system message conversations.finish_reasonis reached and content accumulates across deltas.get_weather+calculate), asserting both tool calls are returned — a scenario previously broken on the OpenAI-compatible path./v1/responsesroute (no chat-completion fallback), asserting amessageoutput item with non-emptyoutput_text.deepseek/deepseek-v4-flashaftergemini/gemini-2.5-flash, and addeddeepseek/deepseek-v4-flashto the streaming section.Type of change
Affected areas
How to test
Import
tests/e2e/api/collections/provider-harness.jsoninto Postman or run via Newman against a live gateway instance with a valid DeepSeek API key configured.Expected outcomes:
choices[0].message.content.finish_reason.tool_callsentries namingget_weatherandcalculate.messagecontaining non-emptyoutput_text.Breaking changes
Related issues
Security considerations
No new secrets or auth mechanisms introduced. DeepSeek API key handling follows the existing provider credential pattern.
Checklist
docs/contributing/README.mdand followed the guidelines