Repository navigation
fix(bailian): support standard reasoning_effort none - #2414
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe Bailian outbound transformer now maps ChangesBailian request transformation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change supports disabling Bailian thinking through standard reasoning_effort requests without changing other effort values. No actionable merge-blocking risk is identified from the supplied evidence. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The reviewed request-format change introduces no material security risk. It preserves existing validation and authentication, does not expand access or privileges, and leaves the original request unchanged. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to Bailian OpenAI Chat outbound behavior and is covered by a focused unit test validating the intended forwarding rules.
Pull request overview
This PR fixes Bailian outbound transformation so that a Bailian-specific top-level enable_thinking boolean provided by OpenAI-compatible clients (via extra_body) is preserved through the OpenAI Chat Completions transformation, ensuring explicit false isn’t dropped.
Changes:
- After delegating to the OpenAI outbound transformer, re-inject
enable_thinkinginto the outbound JSON body only when the inbound raw request contains an explicit JSON boolean. - Leave
enable_thinkingabsent when it’s omitted, null, non-boolean, or when the inbound API format is not OpenAI Chat Completions. - Add unit tests covering
true,false, and various non-forwarded cases.
File summaries
| File | Description |
|---|---|
| llm/transformer/bailian/outbound.go | Preserves explicit boolean enable_thinking from the inbound OpenAI Chat raw request by setting it back into the transformed outbound JSON body. |
| llm/transformer/bailian/outbound_test.go | Adds coverage to verify boolean forwarding and non-forwarding behavior across omitted/null/non-boolean/non-OpenAI cases. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
有几个点,你要的是什么
|
|
更准确地说,是第 3 种里的窄场景:客户端按 OpenAI Chat Completions 调用 AxonHub,并通过 |
|
Hi! This PR has been open for two weeks with all checks green, and I already posted the scope clarification on Sep 17 as you asked. Does the current scope look good to you? If it's not a fit right now, feel free to close it — no hard feelings on my side. |
a943e92 to
c0feb24
Compare
|
Rebased onto latest @coderabbitai review |
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Updated this PR to the narrow standard OpenAI reasoning path discussed above. At d8e5c67, unified The official Bailian documentation describes Verified all transformer packages with @coderabbitai full review |
|
Final validation for d8e5c67: Build Backend, Build Frontend, Test Frontend Unit, lint, test, and CodeRabbit all passed. The fresh CodeRabbit review covers c0feb24..d8e5c67 and reports no actionable comments; there are no review threads. Independent requirements, execution QA, code-quality, security, and context reviews also passed. PR remains open and unmerged. The summary's linked-issue and scope warnings still evaluate the original #2115 native-field proposal. The revised title/body and implementation intentionally follow the maintainer's standard OpenAI format path: only unified |
✅ Action performedFull review finished. |
|
@looplj @remote-controlled-man 想请两位确认一下当前实现方向是否符合前面讨论的预期,先不合并。 当前 head 为
参考百炼官方文档:https://help.aliyun.com/en/model-studio/qwen-api-via-openai-chat-completions 。文档说明部分模型支持标准 这个方向对应前面讨论中的“通过标准 OpenAI reasoning 参数调用百炼”,并不宣称在关闭透传时保留原 issue #2115 的专有扩展字段。PR 标题和描述也已按这个范围更新。 实际 OpenAI inbound → 百炼 outbound 的 JSON 验证、transformer 测试及当前 head 的 CI 均已通过。请两位确认:是否认可上述边界,尤其是 |
|
The revised boundary looks right to me — confirming it.
One housekeeping question on #2115: since the revised PR intentionally does not fix the native-field scenario, how would you like the issue handled? I see two options: (a) keep it open, and I post a short note there documenting the two supported paths (a passthrough channel, or the standard Thanks for the careful rework — validating the |
* fix(bailian): preserve enable_thinking from OpenAI requests * fix(bailian): map standard reasoning none to disabled thinking --------- Co-authored-by: 粒粒橙 <i@llc.moe> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Standard OpenAI clients can disable Bailian thinking with
reasoning_effort: "none". The transformed request sendsenable_thinking: falseand omitsreasoning_effort, following the documented none mapping: https://help.aliyun.com/en/model-studio/qwen-api-via-openai-chat-completions.The adapter uses only the unified request's
ReasoningEffort. Unspecified effort adds no thinking option; every other effort value is forwarded unchanged for the provider/model to interpret. The input request is not mutated, and consecutive tool-call merging is preserved.Raw native
enable_thinkingremains a passthrough-only option. This replaces the original raw-field restoration approach in response to the maintainer's standard OpenAI format discussion. It does not claim to solve #2115's native-field use case without passthrough.Validation: race-enabled, shuffled tests for all
llm/transformer/...packages pass; scopedgopls checkreports no diagnostics. JSON tests cover none, unspecified, other efforts, conflicting raw native flags, input immutability, and actual OpenAI inbound → Bailian outbound conversion. A separate import driver confirms the serialized outbound JSON for none, unspecified, minimal, low, medium, high, and xhigh.Summary by CodeRabbit
nonedisables thinking, other specified values are sent as the reasoning effort, and an unspecified value leaves reasoning settings unset.