fix(proxy): recognize DeepSeek reasoning stream content - #1395
Merged
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughOpenAI Chat 内容帧规则新增 ChangesDeepSeek reasoning 内容支持
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🧪 测试结果
总体结果: ✅ 所有测试通过 |
Contributor
There was a problem hiding this comment.
Code Review Summary
No significant issues identified in this PR.
PR Size: S
- Lines changed: 60
- Files changed: 4
Review Coverage
- Logic and correctness - Clean
- Security (OWASP Top 10) - Clean
- Error handling - Clean
- Type safety - Clean
- Documentation accuracy - Clean
- Test coverage - Adequate
- Code clarity - Good
Automated review by Codex AI
Contributor
There was a problem hiding this comment.
- Completed the PR review for
#1395and posted the GitHub review summary as a comment. - Applied the size label
size/S. - I did not find any diff-scoped issue that cleared the reporting threshold after validating the new classifier change and the added coverage in
src/app/v1/_lib/proxy/stream-gate/frame-classifier.ts,tests/unit/proxy/stream-gate-frame-classifier.test.ts,tests/unit/proxy/stream-gate-content-gate.test.ts, andtests/unit/proxy/stream-gate-forwarder-integration.test.ts. - I also attempted targeted test execution, but this runner does not have
bun/bunxinstalled, so runtime validation could not be rerun locally here.
Merged
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.
Fixes #1394
Summary
choices[].delta.reasoning_contentas valid OpenAI Chat stream content.STREAM_GATE_MODE=off.Validation
bunx vitest run tests/unit/proxy/stream-gate-frame-classifier.test.ts tests/unit/proxy/stream-gate-content-gate.test.ts tests/unit/proxy/stream-gate-forwarder-integration.test.ts(79 passed)bun run typecheckbun run lintbun run lint:fixbun run buildbun run testbun run test:coverageReview
Greptile Summary
This PR updates the OpenAI Chat stream classifier so non-empty DeepSeek
reasoning_contentdeltas count as valid content while empty deltas remain neutral.choices.#.delta.reasoning_contentto the existing OpenAI Chat content paths.Confidence Score: 5/5
The PR appears safe to merge with no actionable defects identified.
The new path uses the classifier’s existing non-empty-value semantics, preserves error-before-content precedence, and is covered at classifier, gate, and forwarding integration levels.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(proxy): recognize DeepSeek reasoning..." | Re-trigger Greptile
Context used: