Conversation
…ng (NVIDIA-NeMo#502) Signed-off-by: Delweng <delweng@gmail.com>
…eMo#502) Signed-off-by: Delweng <delweng@gmail.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
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: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughAnthropic translation now records tool IDs from decoded request history and uses a stateful rewriter for request bodies, buffered responses, and streamed events. The rewriter preserves first-use IDs and assigns distinct IDs to repeated calls while pairing results with the latest assigned call ID. ChangesAnthropic tool ID uniqueness
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change rewrites repeated Anthropic tool-call IDs so results pair with the correct calls. No merge-blocking risk was identified in the supplied context. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue [
A rabbit checks each tool-call name, Comment |
A backend that reuses OpenAI tool-call ids across responses (e.g. Grok emitting
call_0, call_1, call_0) made Switchyard translate that conversation to Anthropic with duplicatetool_useids. Anthropic returns 400 "tool_use ids must be unique", and clients pair results to calls by id, so agent loops never terminated.Translation now treats id uniqueness as an Anthropic-facing invariant: first-seen ids pass through unchanged; a repeat mints
sydup2_call_0-style ids (distinct from thesy64_scheme, original readable after stripping the prefix). The Anthropic request decoder records the ids a conversation already used in request extensions, and both buffered and streaming response encoders seed from that — no new cross-request state. Everytool_resultis rewritten to match its own call.Verified: new buffered/streaming/extension tests fail before the fix and pass after; full translation suite (231 tests),
cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningsclean.Fixes #502
Summary by CodeRabbit