Skip to content

test(ui-react): cut B's recovery read short in the parallel-sessions case - #4058

Merged
schlessera merged 2 commits into
mainfrom
test/3414-parallel-sessions-failure-once
Nov 16, 2026
Merged

schlessera merged 2 commits into
mainfrom
test/3414-parallel-sessions-failure-once

Conversation

@schlessera

@schlessera schlessera commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #3414

What changed

The 390-phone "A and B stream side by side" case in parallel-sessions-runtime.test.ts now always puts B's tracker through the condition that made it announce B's failure twice under load. B's recovery reads are held from just before B fails until the 2:05 fast-forward has cut the in-flight read short (the fake clock also runs the read's AbortSignal.timeout) and B reads can't check. The case then answers them and waits for B to read failed again, before the existing "a ticking age announces nothing" check. The product fix, the announcer keeping its baseline through can't check and unknown, is already on main from #3980 (0f6296a79). This PR supplies #3414's own acceptance: the case fails with that guard reverted under the issue's condition, passes with it, and passes 30 times under load. It touches only the test file, and every assertion and deadline is unchanged.

Why this shape

Proof

All runs used real Chromium 1243 from the pinned Playwright cache, BRAIN_REQUIRE_CHROME=1 bun run test packages/ui-react/tests/parallel-sessions-runtime.test.ts -t '390 phone.*A and B stream', base origin/main at eb3c53ac2, head 2e5166498.

Run Tree Result
Issue condition, failing first main with #3980's guard removed and a temporary 1.5 s hold on B's recovery reads (not committed), --rerun-each 3 0 pass / 3 fail, each at "every change spoken once, and nothing else" with + "Row through Scylla's strait failed.", the diff in #3414
Issue condition, fixed main with the same temporary hold, --rerun-each 3 3 pass / 0 fail, 105 assertions
This PR, mutation this PR with #3980's guard removed, --rerun-each 2 0 pass / 2 fail, each at "a ticking age announces nothing": + "Row through Scylla's strait failed."
This PR, restored this PR, --rerun-each 2 2 pass / 0 fail
This PR under load this PR, --rerun-each 30, 10 busy loops on 16 cores, one-minute load sampled every 15 s: median 24.2 (3.4 at start, up to 28.9) 30 pass / 0 fail, 1050 assertions (issue criterion 3)

The mutation removed the guard (last.has(view.sessionId) && (view.state === "cant_check" || view.state === "unknown")) in packages/ui-react/src/lib/tracker-announcer.ts (observe). It was restored with git checkout before the restored and load runs.

bun install --frozen-lockfile                                   # ok
NODE_OPTIONS=--max-old-space-size=8192 bun run typecheck        # passed
bun run check:pr --base origin/main                             # passed: lint/leakage, env docs, changesets, affected fast invariants (214 pass)

The hosted unit shard that carries this file (issue verification) runs on the ready candidate.

{"version":1,"kind":"brain-check-pr-receipt","head":"2e5166498d62cb0e6027a3c6d40a6fdf83669e00","base":"origin/main","mode":"focused","startedAt":"2026-11-15T21:29:19.658Z","finishedAt":"2026-11-15T21:29:43.247Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":14163.859322000004},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":106.72663699999976},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":97.9387029999998},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":19.533863000004203},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":9183.692573}]}

Collisions (bun scripts/collisions.ts --json --pr 4058 at head 2e5166498, graph built at that head): no path or unknown report. closure only, against 25 open PRs through the ui-react workspace. Of those, #3056, #3059, #3622, #3806, #4002, #4018, #4028, #4041, #4046 and #4050 also reach parallel-sessions-runtime.test.ts in their closure. #3437 is the superseded PR for this issue and is closed.

Checklist

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof. (Local receipts above. Hosted proof follows the ready confirmation.)
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md. (0.45.0)
  • A changeset is included, or this changes nothing a consumer can see. (Test-only.)
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved. (fix(ui-react): keep tracker recovery from repeating announcements #3980 recorded the recovery behaviour in D52.)
  • A fail-closed guard added or changed answers the proportionate-containment checklist in this body, or no guard changed.
  • Provider history stays append-only (docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.

Anything left open

Nothing.

🤖 Generated with Claude Code

…case (#3414)

Under load, B's recovery read after its failure was sometimes still in
flight when the 390-phone case fast-forwarded the page clock 2:05. The fake
clock also runs the read's `AbortSignal.timeout`, so the read aborted, B
went `can't check`, and the next read's same failure was announced a second
time. #3980 fixed the announcer; this makes the condition a step of the case
instead of something only load produces.

B's recovery reads are held from just before its failure until the
fast-forward has turned B `can't check`, then answered, and the case waits
for B to read `failed` again. Every assertion and deadline is unchanged. With
the #3980 guard removed the case now fails at "a ticking age announces
nothing" with the duplicate announcement.

Refs #3414

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera
schlessera marked this pull request as ready for review November 16, 2026 09:36
@schlessera
schlessera merged commit e521dcf into main Nov 16, 2026
50 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-react React chat/files/voice components, stores, WebSocket transport. type: test Coverage, harness or proof work with no behaviour change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-react: parallel-sessions runtime announces B's failure twice under load on 390 phone

1 participant