fix(claude): preserve hosted web search choices - #1428
Conversation
|
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 (8)
📝 WalkthroughWalkthroughClaude inbound translation now emits valid disabled-thinking reasoning and maps forced Claude WebSearch choices to Responses ChangesClaude Responses translation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ClaudeDesktop
participant ClaudeInbound
participant ResponsesSchema
ClaudeDesktop->>ClaudeInbound: Send disabled thinking and forced WebSearch choice
ClaudeInbound->>ClaudeInbound: Set reasoning effort to none
ClaudeInbound->>ClaudeInbound: Map choice to web_search
ClaudeInbound->>ResponsesSchema: Validate translated request
ResponsesSchema-->>ClaudeInbound: Accept request
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 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. |
60ecf33 to
d889767
Compare
|
Refreshed this branch onto current The previous macOS failure was a single unrelated full-suite timeout in Local verification after the rebase:
@Wibias please review the exact head after CI completes. |
|
Thanks @Ingwannu — this was useful because it fixed a real Claude→Responses wire mismatch: disabled thinking was emitting an invalid Merging now. |
Summary
reasoning: { effort: "none" }without the upstream-invalidsummary: "none"{ type: "web_search" }shape so they match the translated hosted tool declarationRoot cause
The Claude inbound translator reused the internal/catalog
nonesummary sentinel on the OpenAI wire, wherereasoning.summaryaccepts onlyauto,concise, ordetailed. The same translator converted a Claude hosted web-search declaration to{ type: "web_search" }but converted its named forced choice to{ type: "function", name: "web_search" }. OpenAI therefore received a choice that could not match any declared function.Contract boundary
The patch repairs the known hosted mapping at translation time and preserves ordinary named function choices unchanged. It deliberately does not downgrade arbitrary unmatched forced choices to
auto, because that would silently relax the caller's required-tool intent and could select a different tool.Verification
bun test tests/claude-inbound.test.ts: 28 passed, 0 failedresponsesRequestSchemaand the realparseRequestboundarybun run typecheck: passedbun run privacy:scan: passedgit diff --check: passedCloses #1426
Summary by CodeRabbit
web_searchtool choices.reasoning.effort: "none"without an unnecessary summary field.