fix(translation): preserve Anthropic tool strictness - #585
fix(translation): preserve Anthropic tool strictness#585cpakkamisaac-sae wants to merge 1 commit into
Conversation
Signed-off-by: Clement Pakkam Isaac <232634418+cpakkamisaac-sae@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe change preserves Anthropic tool ChangesTool strictness translation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change preserves explicit tool schema strictness during request translation without altering endpoints, permissions, dependencies, or deployment behavior. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
ting-hong-shieh
left a comment
There was a problem hiding this comment.
Verified at 32fe68a. The change preserves true and false while leaving omitted strictness absent across OpenAI Chat and Responses. Format, workspace Clippy, and the full translation test suite pass. No blocking findings.
What
Preserve top-level
tools[].strictwhen decoding Anthropic Messages requests so explicit strictness reaches OpenAI Chat and Responses targets.Add regression coverage for
true,false, and omitted strictness across both translated formats.Why
The Anthropic decoder previously replaced every tool's strictness with an absent value, silently disabling schema enforcement after translation.
Closes #577.
Notes for reviewers
Start with
decode_anthropic_tools; the runtime change is one expression. The request-translation test exercises the complete decoder/encoder path for both destination formats.Local validation:
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --locked --offline -p switchyard-translationcargo test --workspace.venv/bin/ruff check ..venv/bin/mypy switchyardfunction.strict: truein the forwarded requestSummary by CodeRabbit
Bug Fixes
strictsetting during translation.Tests
strictvalues translate correctly to OpenAI Chat and Responses formats.