Skip to content

fix(sidecars): replace repeated text-done snapshots - #8197

Merged
lidge-jun merged 15 commits into
lidge-jun:devfrom
oocheol:codex/fix-sidecar-done-snapshots-20261106
Nov 8, 2026
Merged

lidge-jun merged 15 commits into
lidge-jun:devfrom
oocheol:codex/fix-sidecar-done-snapshots-20261106

Conversation

@oocheol

@oocheol oocheol commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix repeated response.output_text.done events duplicating search answers and image descriptions when a compatible Responses server does not include a complete final output array. A full snapshot such as Final answer was appended twice as Final answerFinal answer.
  • Replace the previous snapshot for that content part. Distinct indexed parts remain separate, final completed output keeps precedence, and every received snapshot still charges the existing decoded-payload ceiling.
  • Add six regression cases for indexed/unindexed repeats, updated snapshots, distinct parts, incomplete completed output and decoded-budget enforcement. Update the English/Korean sidecar guides and search contract.

Verification

Windows, Bun 1.4.4, based on latest fetched dev 0a30c5513.

  • Red/green: bun test --no-env-file --isolate ./tests/web-search/fix-search-frame-shapes.test.ts --timeout 30000 failed 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 30000 passed: 197 tests / 0 failures / 598 assertions, 7 import-connected files, 24.06 seconds. OCX_TEST_MAIN_TIMEOUT_MS=120000 bounded 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

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. This parser-only patch changes no authentication, credentials, configuration, dependency versions or CI policy.

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

  • Maintainer follow-up 31f8eb3cc402014174e31bc8d4ee3767def2db09 handles 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.
  • Isolated-home focused search, vision, layout, ratchet and Lab tests: 262 passed, 0 failed; bun run typecheck, bun run privacy:scan, and bun run structure:check passed. A temporary union with current dev passed 216 focused search/vision/ratchet tests.
  • Full local suite and live-provider tests were not run. A non-isolated combined search/vision run had seven failures; the affected files passed separately, and an isolated domain run passed. The maintainer pushed this update with git push --no-verify; exact-head CI is pending.

Co-authored-by: 정우철 [email protected]

  • No-content follow-up fdd297b953195727c91a2ef7eaeb1482492fdc02 triggers the existing ci:full lane after the label was applied. Its tree is identical to 31f8eb3cc402014174e31bc8d4ee3767def2db09; fresh independent review passed. Pushed with git push --no-verify.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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.

Share

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ 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.

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.

@lidge-jun lidge-jun added the ci:full Run the four full Ubuntu test shards on this pull request label Nov 8, 2026
Trigger the existing ci:full PR lane after its label was applied.
@lidge-jun
lidge-jun marked this pull request as ready for review November 8, 2026 15:54
@lidge-jun
lidge-jun merged commit 578c8bd into lidge-jun:dev Nov 8, 2026
36 of 38 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T16:04:46.853364Z fdd297b Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/web-search/parse.ts
&& 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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/web-search/parse.ts
Comment on lines +522 to +523
slots.set(key, { itemId: typeof item.id === "string" && item.id ? item.id : undefined,
outputIndex, contentIndex, singleContent: item.content.length === 1 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:full Run the four full Ubuntu test shards on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants