fix(translation): preserve native Anthropic thinking settings - #878
Conversation
`AnthropicMessagesCodec::encode_request` (crates/switchyard-translation/src/codecs/anthropic/buffered.rs:294-308) now re-emits the caller's native thinking object on the reconstructed path, and only falls back to `{"type": "adaptive"}` when effort is set and no native thinking exists.
Previously, any `reasoning.effort` clobbered thinking with adaptive, so reconstruction disagreed with verbatim replay (a caller sending thinking: disabled + output_config.effort replayed as disabled but reconstructed as adaptive).
GLM 5.3's review:
> Real bug, correctly fixed. README claims match the code, including omit-before-merge ordering and reasoning_effort only applying to OpenAI backends.
Fixes: https://linear.app/nvidia/issue/SWITCH-1490/
Assisted-by: Pi:GPT 6 Astra medium
Reviewed-by: Pi:GLM 5.3 high
Signed-off-by: Graham King <grahamk@nvidia.com>
|
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: Repository: NVIDIA-NeMo/Switchyard/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughAnthropic request encoding now preserves native ChangesAnthropic thinking reconstruction
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change preserves native Anthropic thinking settings while keeping output effort separate. No merge-blocking issue was identified; merge after normal checks pass. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
A rabbit checks the thinking field, Comment |
AnthropicMessagesCodec::encode_request(crates/switchyard-translation/src/codecs/anthropic/buffered.rs:294-308) now re-emits the caller's native thinking object on the reconstructed path, and only falls back to{"type": "adaptive"}when effort is set and no native thinking exists.Previously, any
reasoning.effortclobbered thinking with adaptive, so reconstruction disagreed with verbatim replay (a caller sending thinking: disabled + output_config.effort replayed as disabled but reconstructed as adaptive).GLM 5.3's review:
Fixes: https://linear.app/nvidia/issue/SWITCH-1490/
Assisted-by: Pi:GPT 6 Astra medium
Reviewed-by: Pi:GLM 5.3 high
Signed-off-by: Graham King grahamk@nvidia.com
Summary by CodeRabbit