fix(responses): always carry query on web_search_call for Console Go - #3069
fix(responses): always carry query on web_search_call for Console Go#3069justin-mc-lai wants to merge 2 commits into
Conversation
|
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
|
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 (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe bridge now emits both ChangesWeb-search action contract
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change preserves both singular and plural search fields for new and replayed web-search actions, preventing the reported validation failure; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation All production and test changes directly support issue ✨ 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 |
리뷰 · 우선순위 50 / 80이 PR은 OpenCode Go(저장소에서 부르는 이름은 Console Go / Zen Go)의 네이티브 Responses 경로에서, 예전에 기록된 여러 검색어 지금 HEAD의 검색 아이템은 증상은 이렇습니다. 고치는 코드는 두 곳입니다. 문제는 테스트가 그 옛 계약을 아직 믿고 있다는 점입니다. 라인 149 메인테이너의 판단이 필요한 지점
너의 추천 지금 형태로는 머지하지 마라. 진단(배치 이 댓글은 grok-bot이 작성했습니다 |
DeepSeek's native Responses parser requires 'queries', while Console Go's upstream validator requires 'query'. A multi-query web_search_call emitted by webSearchAction only carried 'queries', so replayed history 400'd on every subsequent turn with: input[N].action missing required field 'query' (sibling of lidge-jun#930). - webSearchAction now always includes action.query (first query) alongside queries, satisfying both strict parsers. - backfillWebSearchQueries repairs pre-existing recorded items in either missing direction (adds queries from query, or query from queries[0]). Verified: a Responses request replaying an old-format multi-query web_search_call now completes instead of 400ing on upstream.
…-jun#3071) - bridge: batched search now asserts both 'query' and 'queries' (was: queries-only), matching the new webSearchAction output. - passthrough: backfill test now asserts the reverse repair direction (multi-query action gains singular 'query'), matching the extended backfillWebSearchQueries.
429be1e to
5cf5cc1
Compare
Ingwannu
left a comment
There was a problem hiding this comment.
Reviewed exact head 5cf5cc1d23025f3e30c8282b0f524212d3b88731. The underlying failure is real and the two-key direction is appropriate: new and replayed search actions need query for Console Go and queries for strict DeepSeek Responses parsers. Two current-head contract issues remain.
-
src/bridge.ts:149-150still statesBatch → { queries } with NO singular queryimmediately before the new explanation and implementation say every batch carries both keys. Update the summary contract so future maintenance does not reintroduce the old shape. -
src/adapters/openai-responses.ts:928-930copiesaction.queries[0]without proving it is a string. A replayed or caller-suppliedqueries: [123], object, or other malformed value now creates a non-stringquery, which still violates the Console Go contract and makes the repair itself produce an invalid shape. Validate the first member before copying. Define the behavior for an emptyqueries: []as well: either repair it to the canonical empty search shape or deliberately leave/reject it, but cover both empty and non-string arrays so the adapter never claims a successful repair with an invalid singular field.
The focused assertions for valid single and batch histories are otherwise aligned with the intended contract. This head currently has only target/hygiene checks, not executed exact-head runtime CI, and is behind the advancing dev release version line. After the two fixes, rebase onto the then-current dev and run the exact-head matrix before approval.
What & why
Fixes #3071 (sibling of #930). A multi-query
web_search_callemitted bywebSearchAction()only carriedqueries(plural). DeepSeek's native Responses parser requiresqueries, but Console Go's upstream validator requires the singularquery— so once a batch search was recorded, every replayed turn 400'd with:Changes
webSearchAction()now always includesaction.query(= first query) alongsidequeries, so both strict parsers are satisfied on new items.backfillWebSearchQueries()repairs pre-existing recorded items in either missing direction — addsqueriesfromquery(was there), or addsqueryfromqueries[0](new), so old conversations heal at the replay boundary and stop 400-ing.Tests
queryandquerieson new items; single-query and empty-query cases unchanged.query).Trade-off
A multi-query batch loses the " ..." ellipsis in codex-rs and shows the first query as the cell label (the same label source Console Go needs).
Verification
Locally patched + restarted the proxy, then replayed an old-format multi-query
web_search_callin a Responses request: completed with 200 instead of the previous 400.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Summary by CodeRabbit
Bug Fixes
Tests