fix(chat): forward caller service_tier through the chat-to-responses conversion (#1886) - #1904
Conversation
…conversion chatCompletionsToResponsesBody dropped service_tier, so a tier declared by a /v1/chat/completions caller vanished before the responses pipeline could see it — fast override, the capability gate, and serialization all behaved as if no tier was requested, while the same request through /v1/responses worked. Copy the field under the converter's existing optional-scalar convention and let the downstream pipeline keep owning the semantics. Flips the A0 known-bug characterization for this exact behavior (FastWire umbrella lidge-jun#1886, independent bug-fix unit), and adds converter + end-to-end regressions including the fail-closed strip on a supportsServiceTier:false route. Full suite at this commit: 12750 pass / 10 skip / 0 fail. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Chat Completions translator now forwards ChangesService tier support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This is a localized fix that preserves an optional service tier during chat-to-responses conversion, with coverage for supported and fail-closed routes. No actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 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 |
|
Gate transparency for the merged head (
Flagging so the baseline failure gets triaged on dev rather than attributed to this branch. |
|
Its baseline is in: #1892 merged as This PR is next in the Wave 5B order and is being held only by its own draft state — all four Two things worth knowing before you tick the boxes:
Ready for review-readiness whenever you are. |
|
Thanks — and the draft state you saw is now cleared: head On your two points:
Local full-suite evidence at The single failure is the pre-existing dev-side one I flagged above — One caveat for the 5B ordering: four suites ( |
…B gate The audit caught a false statement I wrote: lidge-jun#1892 and lidge-jun#1904 are not disjoint, they modify the same two test files. The pair is safe for a better reason - lidge-jun#1904 contains lidge-jun#1892's commit 0cdd07d, so git resolves through the common ancestor instead of seeing two unrelated additions, and the one blob that differs is the intentional A0 flip. Verified both directions, and a sequential merge of all five onto origin/dev in a scratch worktree produced five clean merges. Two things the plan had backwards. lidge-jun#1888's sponsorship label is its third blocker, not its first - it is also CONFLICTING against dev and carries CHANGES_REQUESTED. And the reason not to self-apply that label is sharper than an agent not unblocking itself: MAINTAINERS.md requires explicit security review for auth surfaces, and the label is the record that the review happened, so applying it without doing the review makes the record false rather than merely skipping a step. The train's real gate was never merge order. All five sit behind maintainer approval under Protect dev. Recording per-PR dispositions: lidge-jun#1884 and lidge-jun#1892 are ready, lidge-jun#1902 has no exact-head CI on production routing code, lidge-jun#1904 is a draft with unticked boxes, and lidge-jun#1898 is missing two of the five tests this plan required - account appears zero times in its diff.
Three of six landed: lidge-jun#1884, lidge-jun#1892, lidge-jun#1902. Three carried forward, each with a reason that belongs to the PR rather than to the wave - lidge-jun#1904 is a draft whose author has not ticked its readiness boxes, lidge-jun#1898 is missing the two pacing tests this plan required, and lidge-jun#1888 has three independent blockers including an unsponsored auth surface. Focused verification on the merged tree covers the replay, fastwire and router suites: 54 pass, 0 fail. Dev's own CI at 2a9f083 is still in progress, and the two runs before it were cancelled by supersession, so the branch has no completed green run on its current head yet. That matters for WP9's promotion, not for these merges.
|
Validation before merge: scratch-worktree merge onto |
Windows stack (lidge-jun#1944-lidge-jun#1947, lidge-jun#1949) and FastWire train (lidge-jun#1893, lidge-jun#1965 absorbing lidge-jun#1956, lidge-jun#1904) all terminal on dev; lidge-jun#1885 held behind the B2 pricing gate. Per-PR validation evidence recorded in the ledger; unit moves to _fin per the devlog contract.
Summary
Independent bug-fix unit of the FastWire umbrella (#1886): the chat→responses converter (
chatCompletionsToResponsesBody) droppedservice_tier, so a tier declared by a/v1/chat/completionscaller vanished before the responses pipeline could see it — fast-mode override, the capability gate, and serialization all behaved as if no tier was requested, while the identical request through/v1/responsesworked. The two inbound entries now agree.One production line: copy
service_tierunder the converter's existing optional-scalar convention (typeof === "string", matching the adjacentuser/prompt_cache_keyhandling). No normalization, no injection — the downstream pipeline keeps owning tier semantics, so the fail-closed gate still strips it onsupportsServiceTier: falseroutes.Stacked on the A0 characterization PR #1892, deliberately: A0 locked this bug as a
(known bug)characterization cell, and the design's flip protocol says the bug-fix unit updates that cell in the same change. Review this PR by its top commit. (#1892 is now merged asdec332c49; no rebase is needed — this branch already contains its commit0cdd07d51through common history.)Tests
handleChatCompletions(forced chat→responses fallback): caller tier reaches the outbound body on a tier-capable route; stripped on an explicitsupportsServiceTier: falseroute.Verification
bun x tsc --noEmitclean.Part of #1886 (independent bug-fix unit; shrinks the later B1 migration surface).
🤖 Generated with Claude Code
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Tests