Skip to content

ci: main red at b77987afb857: runtime_host #3884

Closed

Description

@github-actions

Main is red at b77987afb85740fa36b7ab79b123f54edea1a7bf (first failing main run: https://github.com/schlessera/brain-kit/actions/runs/42875027911).

Failing tests and categories:

Hosted proof whose merge ref contains this commit is refused or cancelled, and integrate.ts refuses ordinary confirmation and merges, until a main run that includes this failing set is green.
Declare a fix or targeted revert PR with bun scripts/integrate.ts declare-fix <pr>; the first confirmed fix wins. Only a green main run that includes this failing set clears the record, so a failure that does not reproduce still needs a declared fix to land.

One orchestrator owns the fix: it claims it with bun scripts/red-main-incident.ts claim --worker <id> --orchestrator <id>, which writes the claim into the red-main record. After a quick assessment the claimant chooses a fix PR or a targeted revert PR from causal and current-tree evidence, and records that choice and its rationale here as decision evidence; a red check or the latest squash alone is not proof of cause. Every other orchestrator adds evidence here with bun scripts/red-main-incident.ts evidence ... instead of opening another issue.

Possibly related open issues: #2202, #2309, #2793, #3398, #3414, #3436, #3723, #3803, #3807.

Activity

  1. added
    type: fix
    area: ci
    on Nov 10, 2026
  2. self-assigned this
    on Nov 10, 2026
  3. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Fix claimed by worker wi-20261110-r3884 (orchestrator orch-0988fe94).

    • Main red at b77987afb857 (record run 42875027911).
    • Claim term ends 2026-11-10T19:52:12.000Z; the claimant renews it with bun scripts/red-main-incident.ts renew. After it ends, any orchestrator may take the fix over with claim.
    • Everyone else: add evidence here with bun scripts/red-main-incident.ts evidence; do not open another incident.
  4. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: ruled-out

  5. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: related

  6. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: reproduction

    • Incident: main red at b77987afb857 (record run 42875027911)
    • From: worker wi-20261110-r3884, orchestrator orch-0988fe94 (claimant)
    • SHA: b77987afb85740fa36b7ab79b123f54edea1a7bf
    • Summary: parallel-sessions reproduces locally under load at b77987a (1/5), not at parent b6c330a (0/5); A at bottom but never seen
    Local repro of the `parallel-sessions-runtime` case "1440 desktop, light, fine pointer…", run under CPU load (10 busy loops on a 16-core host). Runs alternated between first-bad `b77987afb` and its parent `b6c330a60`.
    
    - `b77987afb`: 1 failure in 5 runs, the same 30 s "Scroll to latest" wait as main.
    - `b6c330a60`: 0 failures in 5 runs.
    
    A local-only diagnostic at the 3-second fallback captured the state at 3 s and again at 11 s. Both captures are identical:
    
    - The transcript scroller is at the bottom: scrollHeight 3334, clientHeight 735, gap 0.
    - So the missing disc is correct.
    - One image is in the transcript, a sent thumbnail that has finished loading (64×78, data URL).
    - The composer holds no image.
    - Session A is `done`, `settled` and `cleared: false`.
    
    **Ruled out:** the viewport-shrink hypothesis posted on #3807. The reader is at the latest turn, and the seen observer still never clears A. Next, I am capturing which `observeTrackerSeen` condition fails, using the `use-tracker-seen.ts` checks.
    
  7. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: ruled-out

    `packages/ui-server/tests/safety-history.test.ts` › "real WS replay and contiguous updates survive duplicate/reordered delivery without count reduction" failed again in run 42875027911 (job `unit (2)`), with `Error: Safety frame deadline` after 15382 ms.
    
    #3846 raised that fixture's frame deadline from 3 s to 15 s on the hypothesis that a loaded shard delivered the frame late (#3845). That hypothesis is now ruled out: with five times the budget, the awaited frame still never arrived. This points to a frame that is sometimes never sent, or sent before the waiter can see it, rather than slow delivery. Candidates for the claimant to check, none confirmed:
    
    - `through()` loops until an update shows an exact `unresolvedCount` with `pendingCount===0`. If the poll coalesces B and C, or delivers the target count while `pendingCount>0`, it waits forever.
    - `f.history.poll()` races the subscription's registration after `safety_subscribe`.
    
    The fixture's `until()` removes a matched frame from `frames`, so a matching frame that arrived before `until()` was called is still found by the initial `check()`. That rules out a lost early frame inside the helper itself.
    
    The 15 s deadline from #3846 is harmless but does not fix this. A real fix needs the missing frame's cause.
    
  8. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: reproduction

    • Incident: main red at b77987afb857 (record run 42875027911)
    • From: worker wi-20261110-r3884, orchestrator orch-0988fe94 (claimant)
    • SHA: b77987afb85740fa36b7ab79b123f54edea1a7bf
    • Summary: failing gate is last.turnId: the image-carrying queued follow-up and its reply come back with turnId null, so the tracker can never be seen
    This is a second local capture at `b77987afb` under load. The case failed on run 3 of 3. A probe that mirrors the `observeTrackerSeen` checks (`use-tracker-seen.ts`) showed this.
    
    **Every gate passes except the last-message link.**
    
    - The view is `chat`, with no panel, modal or sheet over it, and the document is visible.
    - The transcript gap is 0.
    - The tracker key is turn `ea8b79b2…`, revision 2. Evidence is `terminal`/`success`, settled.
    
    **The links:**
    
    - The session buffer has 4 messages.
    - The earlier exchange's assistant message is linked (turn `2fa9ecde…`).
    - The queued follow-up has a `null` `turnId` on both messages: the user message "Hold: Then bind me to the mast…", which is the one carrying A's image, and its assistant reply. This is the same at 3 s and at 11 s.
    
    So `last.turnId !== key.turnId`, and nothing can ever observe A as seen. Hiding "Scroll to latest" is correct, because the reader is at the bottom.
    
    **Working hypothesis, being checked now.** Replay links a user message to its turn only when its `<brain-attachments>` block reproduces the recorded `attachment_files` byte for byte (`attachLiveSources`, `packages/ui-server/src/ws/message-sources.ts:149-198`). #3805 made image files' recorded metadata depend on when the host finished storing them. If the block in the prompt and the recorded files differ, the image-carrying follow-up comes back unlinked.
    
  9. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: decision

    **Choice: fix, by landing #3803's teardown-race fix (branch `fix/turn-boundary-replay-race`, `fa6b976f1`) as the declared fix. No revert of #3805.**
    
    **Cause evidence, `parallel-sessions-runtime`:**
    
    - A local load repro failed 3 times in 14 runs at `b77987afb` and 0 times in 5 runs at parent `b6c330a60`.
    - A probe that mirrors `observeTrackerSeen` showed every gate passing except `last.turnId === key.turnId`.
    - The replayed follow-up's user row came back with its `source` and `attachmentFiles` joined and its block stripped. Only its turn link was missing. The answer replayed with neither `turnId` nor `journal`, while the earlier answer had both.
    - So the turn boundary was absent when history was read. That is #3803's mechanism:
      - The boundary is recorded in `finish`, after host teardown.
      - A history read issued between the turn's `result` and `finish` replays the answer unlinked.
      - Nothing replays it again.
    - #3803 recorded this before #3805 merged: 3 failures in 3 runs on `main` with a plain-text composer original. A follow-up carrying `attachmentRefs` tears down more slowly. #3805 makes every image an attachment ref, so it widened the window on main. It did not introduce the race.
    
    **Why not revert:**
    
    - #3805 is not the cause. Reverting it would only narrow the window again and leave the race in place.
    - Nothing has landed after `b77987afb`, so there is no conflict either way.
    - The fix is server-only (`turn-failures.ts`, `backend-entry.ts`, `bridge-capabilities/emission.ts`). It touches nothing #3805 changed.
    
    **The other two failures:**
    
    - `runtime_host` and `safety-history` are outside #3805's diff (`ui-react` and docs only).
    - `runtime_host` passed at the parent. `safety-history` is the frame-deadline flake (#3845/#3846).
    - Neither has a fix in this PR. The recovery run must pass them as they stand.
    
  10. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: related

  11. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Red-main evidence: fix-attempt

  12. github-actions commented on Nov 10, 2026

    @github-actions
    Author

    Main is green again: run https://github.com/schlessera/brain-kit/actions/runs/42902524230 at 462afada57126a8c3792d2327eff295f0dc24cb9 included the failing set and passed. The red-main record is cleared.

  13. schlessera commented on Nov 10, 2026

    @schlessera
    Owner

    Recovered.

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

Metadata

Metadata

Assignees

Labels

area: citype: fix

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions