Skip to content

Lane A driver: a watch keeps its last reshaper until a new stream opens, so the final subagents body reaches it (X-168 on the mini) - #882

Merged
SSFSKIM merged 2 commits into
masterfrom
lane-a-reshaper-race
Nov 27, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
lane-a-reshaper-race

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Lane A's driver lost the final subagents body of a watched terminal session when the session's process was found gone after the watch's stream had already tried to reopen. As a result, lane-a.spec's X-168 case and the bridge-goes case fail on the Mac mini, on plain master as well as on branches.

The race

When a bridge closes, the watch's stream ends and its reopening attempt runs after a 500 ms backoff. That attempt cleared the watch's reshaper before any snapshot came. When the process-gone discovery (the bridge directory's notice, the state stream's reprobe, or the registry's holder going) landed after the attempt, which is likely on a slow host, the body saying every agent ended with the session went to no watch. The watch then ended with its last body still saying the agents ran, and the window forgot them as no longer known to run.

The fix in src/services/lane-a/driver.ts: a watch keeps the reshaper of its last opened stream until a new stream's snapshot replaces it. A new open flag says whether the current stream's snapshot came. It decides the two things the old code inferred from a missing reshaper or stream: whether a broken stream announces a reset, and whether a body goes to the watch while the process runs. Once the process is gone, every watch that ever opened hears the final body. This is what the code's own comment already said was intended ("its reshaper stays until the stream opens again"). The second commit only keeps each stream's reshaper in a local so that tsc narrows it.

Validation Evidence

What the failing panel shows. Every failure has the same Agents panel, and no Playwright trace was kept. It shows "Status is known only while the session runs here" and "Earlier N", with no Done section. That sentence is drawn only when the window holds no lane A status other than unknown for the session. So the agents were forgotten, not shown late.

This was seen in all four branch failures examined (three question-sheet-c3 heads and its control run at 3863923) and in the master failures below.

Unit test. src/services/lane-a/driver.test.ts, "says every agent ended with the session to a watch whose stream is opening again when %s, before the watch ends". It covers two ends: the holder ending, and the bridge going with its process. In both, the watch's next stream has been asked for and is unanswered when the session ends.

  • Before the fix: 2 failed, expected 'running/bridge' to be 'exited/session'.
  • After the fix: driver.test.ts passes 98/98.

Before: plain master, e2e:lane-a with --lane no-hosted (the group on the mini). Master's X-168 and bridge-goes cases sit at :810 and :888.

Commit Run X-168 (:810) bridge goes (:888)
3860283 46045126445 failed failed
3860283 46045210798 failed failed
3860283 46045293955 failed failed
a873c6f 46045169950 passed passed
a873c6f 46045251728 failed passed
a873c6f 46045334890 failed passed

Every run was otherwise green; the other 24 or 25 cases passed in each. Three earlier runs of each commit without --lane no-hosted ran on the hosted Mac only, and all passed there.

After: this PR's head 24e9866.

  • 46044133874: static, unit and e2e:lane-a (hosted) green.
  • 46044222157: e2e:lane-a on the mini green.
  • 46051964590: e2e:lane-a on the mini (--lane no-hosted): green, 26 of 26 passed.

Supporting evidence, the same change before the tsc-only second commit:

  • 46042786768 at 33f9546: lane-a on the mini green.
  • On the question sheet's M4 head, cherry-picked: 46041696261 and 46041713455, mini copy of lane-a green.

Sminos-Session: question-sheet-design#23738737 (MAWS on macbook)

…ns, so its final body reaches it (X-168 on the mini)

A watch whose stream broke asked for the next one after its backoff, and that attempt nulled the watch's reshaper before
any snapshot came. When the session's process was then found gone (the bridge directory's notice or the registry's
landing after the 500 ms backoff, as on a slow host), the body saying every agent ended with the session skipped the
watch, which ended on its last body, the agents running. The window, told the watch ended with agents running, forgot
them as no longer known to run, so the panel listed them under Earlier and never read "session ended" (lane-a.spec's
X-168 and the bridge-goes case at :895).

The reshaper is now replaced only when a stream's snapshot opens it; `open` says whether the current stream has, which
decides the reset a broken stream announces and whether a body goes to the watch while the process runs.

Sminos-Session: question-sheet-design#23738737 (MAWS on macbook)
… checker sees it set past the snapshot

The reshaper race fix read `w.reshaper` after the snapshot branch, which tsc cannot narrow (TS18047). Each stream now
keeps the reshaper its snapshot made in a local; the watch's field still keeps the last one across reopening attempts.

Sminos-Session: question-sheet-design#23738737 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 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-27T18:53:49.033862Z 24e9866 PR opened
ℹ️ 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.

@SSFSKIM
SSFSKIM merged commit 0e903ea into master Nov 27, 2026
@SSFSKIM
SSFSKIM deleted the lane-a-reshaper-race branch November 27, 2026 19:00
@SSFSKIM

SSFSKIM commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Landed master-first as 0e903ea (parents a873c6f, 24e9866; tree = the gated head's; probes run 46053178316 added to complete class 1a). Remote branch removed; the worktree in the main checkout is its session's.

Sminos-Session: master-landing-architect#37052769 (MAWS on macbook)

SSFSKIM added a commit that referenced this pull request Nov 27, 2026
Sminos-Session: ux-wave#10d85d03 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 27, 2026
master-first; class 1a 46054547216 and desk-web 46054569546 green on tree 940f043 (= head). Mac at 0f3509a and 629f913; since then only the dashboard-scale tracker row and #882's lane A files. Owner approved the pictures 2026-11-27. dashboard-scale line 4 is master's (tracker row of 2026-11-27). Tracker merge keeps every master row. #720 stays open.

Sminos-Session: master-landing-architect#37052769 (MAWS on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant