Repository navigation
fix(sidecars): replace repeated text-done snapshots - #8197
Conversation
|
Caution Review failedThe pull request is closed.
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
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. |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
Trigger the existing ci:full PR lane after its label was applied.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdd297b953
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| && outputCandidates === (match.outputIndex === undefined ? 1 : 2)) { | ||
| const buckets = contentIndex === undefined ? [outputBucket] : [outputContentBucket, outputUnknownContentBucket]; | ||
| const anonymous = buckets.flatMap(bucket => bucket ? [...bucket] : []) | ||
| .find(part => part !== match && !part.itemId && compatible(part)); |
There was a problem hiding this comment.
Reject content-index conflicts when linking snapshots
When a linking response.output_text.done omits content_index, compatible(part) compares the anonymous candidate only against that incomplete frame, not against match's accumulated content index. For example, with unpositioned drafts for a and b both at content index 1, an anonymous snapshot C at (output=1, content=0), and then snapshot B for {item_id:'b', output_index:1}, this branch merges the content-1 draft into the content-0 snapshot and overwrites C. Without an authoritative final output array, that distinct answer/caption block is lost. Compare both accumulated identities before joining, and retain their known fields in the surviving part.
Useful? React with 👍 / 👎.
| slots.set(key, { itemId: typeof item.id === "string" && item.id ? item.id : undefined, | ||
| outputIndex, contentIndex, singleContent: item.content.length === 1 }); |
There was a problem hiding this comment.
Keep completed item positions when content is malformed
Given unindexed streamed items a: 'First. ' and b: 'Second.', and a completed array whose first message is {id:'a', type:'message', content:null} while the second contains valid text for b, only b receives a slot. Reconciliation moves it ahead of the still-unpositioned a, returning Second.First. instead of the pre-change First. Second.. Preserve message-level ID/output-position information even when content is malformed, or preserve the streamed fallback order when reconciliation is partial; otherwise a malformed optional field silently reorders valid search answers and image descriptions.
Useful? React with 👍 / 👎.
Summary
response.output_text.doneevents duplicating search answers and image descriptions when a compatible Responses server does not include a complete final output array. A full snapshot such asFinal answerwas appended twice asFinal answerFinal answer.Verification
Windows, Bun 1.4.4, based on latest fetched
dev0a30c5513.bun test --no-env-file --isolate ./tests/web-search/fix-search-frame-shapes.test.ts --timeout 30000failed 4 cases before the runtime change (25 passed).bun run test:changed ./tests/web-search/fix-search-frame-shapes.test.ts ./tests/web-search/web-search-eof.test.ts ./tests/web-search/web-search-parse.test.ts ./tests/web-search/web-search.test.ts ./tests/web-search/web-search-terminal-refusal.test.ts ./tests/web-search/web-search-sources.test.ts ./tests/vision/vision-routed.test.ts ./tests/vision/vision-fail-closed.test.ts --parallel=1 --timeout 30000passed: 197 tests / 0 failures / 598 assertions, 7 import-connected files, 24.06 seconds.OCX_TEST_MAIN_TIMEOUT_MS=120000bounded the wrapper.bun run typecheck— passed, 2,316 files.bun run structure:check,bun scripts/file-size-ratchet.ts,git diff --check— passed.cd docs-site; bun install --frozen-lockfile; bun run build— passed, 641 pages / 93,146 checked internal links. Existing Vite chunk-size warnings remain.bun run privacy:scan— passed.Scope exception: the changed-test command above intentionally restricts discovery to the named parser/search/vision files and uses one worker. An earlier unrestricted run over this import graph on this Windows host reached 900 seconds with timeouts and teardown failures. That run is not passing evidence, and it is not represented as a validation of this head. Full unrestricted changed-graph/full-suite and cross-platform validation remain for CI and independent review. No live provider, account or native Codex client was used. This PR remains Draft.
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.
Maintainer integration verification
31f8eb3cc402014174e31bc8d4ee3767def2db09handles repeated snapshots and distinct, partial identities while retaining bounded lookup. Regressions for identity transitions and duplicate output failed before their corrections and passed afterward. A fresh independent review passed.bun run typecheck,bun run privacy:scan, andbun run structure:checkpassed. A temporary union with current dev passed 216 focused search/vision/ratchet tests.git push --no-verify; exact-head CI is pending.Co-authored-by: 정우철 [email protected]
fdd297b953195727c91a2ef7eaeb1482492fdc02triggers the existingci:fulllane after the label was applied. Its tree is identical to31f8eb3cc402014174e31bc8d4ee3767def2db09; fresh independent review passed. Pushed withgit push --no-verify.