Conversation
|
✅ 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: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Chat-to-Responses translator now adds ChangesReasoning Summary Compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The translator now emits the required empty reasoning summary while keeping provider reasoning out of visible summary content; no merge-blocking risk is supported. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
리뷰 · 우선순위 74 / 80설명 이 PR(#4629, 고치는 방법은 한 줄에 가깝다. reasoning 아이템에 테스트는 74점 이유: 현재 릴리스(2.55.0 계열)에서 Chat→Responses 도구 연속 턴이 깨지는 명확한 회귀를, privacy 경계를 지키며 최소 diff로 막는다. Claude 쪽은 이미 summary를 내고 있어서 Chat 경로만의 구멍이다. 점수를 더 올리지 않은 이유는 로컬 스키마는 여전히 summary optional이라 ‘다른 생성 경로가 또 omit하면 같은 400이 난다’는 계약을 스키마로까지는 조이지 않았고, 라이브 Astra 재현 로그는 PR에 없고 단위 핀만 있기 때문이다. 그래도 머지 후보는 분명하다. 라인 ~316 src/chat/inbound.ts - 기존 push는 content만 있었다. 이번엔 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
abhisheksharma2411
left a comment
There was a problem hiding this comment.
Read this against f48e5829. The fix looks right to me, and I think the reason it's right is a bit stronger than the PR body claims — worth writing down, plus one thing I'd want your read on.
The shape isn't new, it's the one the bridge already uses. I went looking for whether summary: [] or summary: [{summary_text}] was the correct call here, and the codebase already answers it consistently:
| site | summary | content |
|---|---|---|
src/bridge.ts:702 (raw reasoning) |
[] |
[{reasoning_text}] |
src/bridge.ts:1831 (raw reasoning) |
[] |
[{reasoning_text}] |
src/bridge.ts:684, :1810 (summary reasoning) |
[{summary_text}] |
— |
So the rule in force is summary holds summary text, content holds raw text, and a raw item carries an empty summary. chat/inbound.ts was the one raw-reasoning producer not following it. That's a cleaner justification than "empty satisfies the wire shape", because it means you're not making a privacy judgement call here at all — you're matching the two sites that already made it.
I also checked src/claude/inbound.ts:259, which does put text into summary, in case this introduced an inconsistency. I don't think it does: Anthropic thinking blocks are already the user-visible summarized form, not raw provider reasoning, so summary is the right slot there. Different input, same rule.
The one thing I'd push on: the schema still admits the bug.
src/responses/schema.ts:69 is still summary: z.array(summaryTextSchema).optional() — which is exactly what #4628 names as the reason the broken payload passed local validation and only failed upstream. This PR fixes the producer and leaves the validator permissive, so a fifth reasoning-item producer added next month regresses identically and still passes bun test + typecheck locally, with the 400 showing up at Astra again.
I'm not saying make it required, because I don't think you can: reasoningItemSchema is a member of inputItemSchema (schema.ts:111), which validates input on the inbound request (schema.ts:155). Tightening it would start rejecting client payloads that omit summary, and a client is entitled to omit it on a request — the requirement is on replay to OpenAI, not on what we accept. So the obvious fix is the wrong one.
Which leaves the guard somewhere else, and I'd rather ask than prescribe. Something like a test that sweeps the Chat→Responses projection and asserts every emitted type: "reasoning" item has summary defined, rather than asserting it at out[idx] for the one item the two current tests construct — that catches a new producer on this path without touching what the proxy accepts. Does that match how you'd want it guarded, or is there a producer-side invariant helper already that I've missed?
Two smaller notes, neither blocking:
- The
structure/data-planes/inbound-compat.mdwording ("The item always carriessummary: []") is now a documented invariant with nothing enforcing it, which is the same gap from the doc side. If the sweep test above happens, that sentence becomes true-by-test rather than true-by-convention. - Your verification note that the surrogate byte-accounting failure also reproduces on unmodified
origin/devat4f788f91is the right way to report a pre-existing red — thanks for pinning the base commit rather than just calling it unrelated.
|
Superseded by the broader merged fix in #4673 ( |
Fixes #4628.
Summary
summary: []on Chat-to-Responses assistant reasoning replay itemsreasoning_contentonly incontentinstead of exposing it as a visible summaryWhy
OpenAI Responses requires the
summarymember on replayed reasoning items. The local schema allowed it to be absent, so Astra tool continuations passed local validation and failed upstream withmissing_required_parameter.Using an empty summary satisfies the upstream shape without reclassifying raw provider reasoning as a user-visible summary.
Verification
bun test tests/responses/chat-inbound-reasoning-replay.test.ts— 11 passbun run typecheck— passbun run structure:check— passbun run privacy:scan— passbun test tests/responses/chat-completions-endpoint.test.ts— 121 pass, 1 existing unrelated failureorigin/devat4f788f916ed08f629303f5e5608b275f56e59f77All tests used isolated temporary
HOME,OPENCODEX_HOME, andCODEX_HOME; protected local runtime settings were unchanged.@lidge-jun This is a narrow current-release regression fix. Please review the exact head before merge; I will not self-approve.
Summary by CodeRabbit