fix(responses): preserve Meta Muse tool-choice semantics - #5969
shawn-kim-ai wants to merge 2 commits into
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: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (13)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughMeta Responses requests now normalize tool selection at the final request boundary. Unsupported choices return HTTP 400 before an upstream request. Tests and documentation cover this behavior; other Responses destinations retain their existing behavior. ChangesMeta Responses tool-choice handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant ResponsesClient
participant preparePassthroughExchange
participant passthroughAdapter
participant normalizeMuseToolChoice
participant MetaResponses
ResponsesClient->>preparePassthroughExchange: Submit Responses request
preparePassthroughExchange->>passthroughAdapter: Build finalized request
passthroughAdapter->>normalizeMuseToolChoice: Normalize Meta tool choice
normalizeMuseToolChoice-->>passthroughAdapter: Return normalized body or compatibility error
passthroughAdapter->>MetaResponses: Send request when normalization succeeds
preparePassthroughExchange-->>ResponsesClient: Return redacted HTTP 400 for compatibility error
Merge Risk: ⚪ Minimal · up to The audit date needs no correction, and the inspected request paths preserve the intended Meta tool-choice behavior. No identified issue blocks merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Unsupported tool choices are now rejected before forwarding to Meta, while supported choices and other destinations retain their intended behavior. The change is narrowly scoped, though not every dispatch path has been verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. (7 skipped: 7 unsupported.)
✨ 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 |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
리뷰 · 우선순위 16 / 80Meta Muse는 선택을 빼거나 바탕 브랜치는 라인 - 메인테이너의 판단이 필요한 지점 압축 요청은 도구와 판별은 모델 이름이 아니라 너의 추천
이 댓글은 grok-bot이 작성했습니다 |
) Six focused fixes from the assigned bug batch remain as separate attributed commits. | PR | Change | Author | | --- | --- | --- | | #5969 | Preserve Meta Muse tool-choice semantics and reject unsupported selectors before dispatch. | shawnkim | | #5944 | Remove unsupported hosted web-search declarations for Xiaomi MiMo destinations. | codingbo | | #5938 | Restart the Windows service child after unexpected exits, including exit 0, while reserving the intentional stay-out code. | codingbo | | #5935 | Reject Claude message-thread state on translated routes so the client resends full history. | kaladinhonor | | #5939 | Rewrite standalone `\\0` escapes in Meta tool-schema patterns to equivalent `\\x00`. | boblob6969 | | #5951 | Preserve Kiro-reported credits across stream attempts and in the usage ledger. | codingbo | A separate integration commit keeps upstream-controlled Kiro event-type text out of opt-in debug logs. The Kiro stream retains the previously landed bounded HTTP-error text when combined with credit metering. Left out: #5977. Independent security review found that its local read capability authenticates the request but not the HTTP response. A substituted listener could return a shape-valid forged `protected` verdict. A correct server proof bound to the nonce, endpoint, and body is outside this batch. Both its source commit and status-validation follow-up were reverted in new commits; its test and layout entries are gone. The source PR remains open. Co-authored-by: shawnkim <shawnkim@markncompany.co.kr> Co-authored-by: codingbo <cnsdbo@163.com> Co-authored-by: kaladinhonor <266145786+kaladinhonor@users.noreply.github.com> Co-authored-by: boblob6969 <boblob6969@icloud.com>
Summary
Meta Muse rejects non-auto tool choices, so Grok Build requests can fail upstream with HTTP 400. Preserve
noneby removing tool declarations and omitting the selector; reject forced, named, and allowed-tools selectors locally instead of silently relaxing their meaning. Validate the original selector before tool filtering can erase that intent. Other provider destinations retain their existing behavior.Verification
bun run typecheck,bun run structure:check,bun run privacy:scan, andbun run --cwd docs-site buildpassed. Focused run:bun scripts/test.ts tests/responses/responses-muse-tool-choice.test.ts tests/responses/responses-muse-tool-name-alias.test.ts tests/providers/muse-tool-name-alias.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts(52 passed).nonewithout tools and rejected constrained selectors with zero upstream sends.bun run test: parallel segment 31,644 passed / 38 skipped / 1 timeout in the existing Claude model-discovery test; the serial native-codex-toggle test also failed (absentinstead ofcurrent); other serial segments passed. The native-toggle failure reproduced identically on the pre-fix baseline (12 passed / 1 failed), so it is not introduced by this patch. Full-run totals: 32,276 passed / 61 skipped / 2 failed. The timed-out file then passed alone (13/13), including that case in 71 ms. The full invocation remains recorded as failed. The native-toggle baseline failure is a local launchd ownership refusal: a job is loaded but its plist is absent in the isolated test home. The guard correctly refuses the write, leavingstate: absent; it was not bypassed. Both baseline and patched runs produce the same failure. Focused coverage and typecheck pass; clean-host full-suite confirmation remains for CI before merge.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit