Skip to content

fix(sidecars): stop after the first terminal event - #8209

Draft
oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-sidecar-terminal-boundary-20261106
Draft

oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-sidecar-terminal-boundary-20261106

Conversation

@oocheol

@oocheol oocheol commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix sidecar results depending on network chunk boundaries. After a terminal event, frames in the same chunk could append text, replace final output, overwrite the error or consume the decoded budget; the same bytes delivered in separate chunks stopped at the terminal as intended.
  • Ignore frames after the first terminal event or [DONE] in the shared search/vision parser. The terminal frame itself is still fully processed, and existing EOF, byte/decoded limits and cancellation behavior remain intact.
  • Add ten whole/fragmented-stream regressions covering completion aliases, the sentinel, late text/errors, failed-response ownership and decoded-budget accounting. Update English/Korean sidecar guides and the search contract.

Verification

Windows; Bun 1.4.4; independent commit on dev d0c8151a720ac2a42d32eea9b4fb76bff0072dc6, fetched at task start.

  • Red/green: the expanded web-search-eof.test.ts failed 5 cases before the runtime fix (28 passed); the one-chunk cases differed from the fragmented cases.
  • bun run test:changed ./tests/web-search/web-search-eof.test.ts ./tests/web-search/web-search-parse.test.ts ./tests/web-search/fix-search-frame-shapes.test.ts ./tests/web-search/web-search.test.ts ./tests/web-search/web-search-terminal-refusal.test.ts ./tests/vision/vision-routed.test.ts ./tests/vision/vision-fail-closed.test.ts --parallel=1 --timeout 30000 — 201 passed / 0 failed / 602 assertions, 7 files, 24.86 seconds.
  • bun run typecheck — passed, 2,317 files.
  • bun run structure:check, bun scripts/file-size-ratchet.ts, bun run privacy:scan, git diff --check — passed. Structure checking was repeated after moving the contract paragraph to avoid a documentation merge conflict with fix(sidecars): replace repeated text-done snapshots #8197.
  • cd docs-site; bun install --frozen-lockfile; bun run build — passed, 641 pages / 93,150 checked internal links. Existing chunk-size warnings remain.
  • Combined preview with fix(sidecars): replace repeated text-done snapshots #8197, fix(sidecars): preserve final citation titles #8198, fix(jsonc): accept one leading UTF-8 BOM #8205 and fix(usage): count supplementary Han in token estimates #8207: clean temporary merge after the documentation adjustment. bun test --no-env-file --isolate ./tests/lib/fix-jsonc-cr-comments.test.ts ./tests/lib/fix-jsonc-empty-comma.test.ts ./tests/lib/token-estimate.test.ts ./tests/web-search/web-search-eof.test.ts ./tests/web-search/web-search-parse.test.ts ./tests/web-search/fix-search-frame-shapes.test.ts ./tests/web-search/web-search-sources.test.ts --timeout 30000 — 174 passed / 0 failed / 357 assertions, 7 files, 3.35 seconds. The preview merge was aborted; this branch contains only its terminal-boundary fix.

The changed-test command restricts discovery to the listed files and one worker, with OCX_TEST_MAIN_TIMEOUT_MS=120000. A previous unrestricted import-graph run on this Windows host reached 900 seconds with timing/teardown failures; it is not passing evidence for this head. Full unrestricted changed-graph/full-suite and non-Windows execution remain unverified and are left to CI/independent review. All provider streams are synthetic; no live account or native 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. No credential, authentication, routing, workflow, dependency or limit configuration changes.

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.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This PR stays in draft until every box above is ticked.

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant