Repository navigation
cua: the hello goes out once the connection is counted (browser-cua :493, an inspector-interrupt race) - #327
Merged
Merged
Conversation
…ed (fails: it reads 0) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
… :493 case keeps a witness Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…fails: it reads 0) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
…ke was an inspector read inside main's synchronous code (#327); its tracker row closed Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
…'s start rows.ts keeps O8 M5's memberNames import and takes repoProjectId from @shared/machine/project-ids, where M3 moved it. Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
SSFSKIM
added a commit
that referenced
this pull request
Oct 29, 2026
…rds at 3d1f3ff) into p5-o3-c at M6 Conflicts, each resolved so both sides hold: - src/main/index.ts: M4's side. O9's lane A block sat in the stretch of startMain that M4 moved into startSpine (the index, attention and the index source it reads are the spine root's now), so it and its three imports leave main's root here; the fold that follows composes lane A in startSpine (O3-C D20, O3 Decision Log 13). At this commit lane A is not composed. - src/main/attention/notifier.ts: both comments; the notifier reads through the view (R1) and keeps lane A's in-app-only rule (O9 M6, Q5). - eslint.config.js: M3's narrowed MACHINE_BOUND (and its tests' list) gains lane-a while it is under src/main/. Beyond the conflicts: lane A's imports of paths M3 moved are re-pointed (atomic-write to @shared/fs, git's runner to src/services/git/, the two value imports marked as rule B's exception until the fold moves lane A); O9's new notifier case drives the fake view rather than a read model writer. Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flake
e2e/browser-cua.spec.ts's orphaned-connector case readconnections: 0, refused: 0at :493, right after the trusted fake host heard MAWS's hello, on hosted Macs (40299148379; 40751164658 flaky; 40771309800 red on the try and its retry; 40794571273 flaky). The tracker row's reading was an accepted connection that closed between the hello and the first read. It was not a close.Root cause (proven on hosted Macs)
The e2e reads main through Playwright's
electronApp.evaluate, which runs over Node's inspector (--inspect=0,Runtime.callFunctionOn). Node dispatches inspector messages at the next V8 interrupt, which can fall between two calls inside main's synchronous JS, not only between event-loop tasks. The server wrote the hello insideCuaConnection's constructor, beforedecideadded the connection to its set. When main's thread stalls inside that write, as it can on a loaded 3-vCPU hosted VM, the test gets the hello and sends its read, and the read then runs before theadd.Evidence:
inspecttogether with the step it ran after), and a 40-launch loop of the :493 read ran on that tree, with Playwright's retry. Of 160 launches, 13 read 0 (4+4 and 3+2). In every one of the 13, the read ran after "hello writing" and before "hello written", inside the hello's own write and before the add. A second read right after returnedconnections: 1each time, and the fake host's socket was still open. No connection had closed.--inspectand a WebSocket client confirmed the mechanism. ARuntime.evaluatesent after the target's "write" read a global set before the write. It ran while the target was still inside synchronous code, before the target set the global's next value.The fix
src/main/browser/cua/index.ts,connection.ts: the connection is counted first, then greeted (greet(), moved out of the constructor), then read. A refused peer is counted and logged before its socket is destroyed. The refusal has the same race at :520, where the test readsrefusedafter the orphan sees the close.[browser]line naming the session, how long the connection lasted, and the cause: why MAWS ended it, the socket error code, or "the host ended it". Until now a closed connection left nothing in main's log. Like the existing lines, it names no params and no content.collectMainOutputviaonLaunched), the first read with the fake host's newsocketState(), and a second read when the first misses. AnafterEachprints the witness and attaches it only when the case failed and the app has closed, so a future red carries main's[browser]lines and the socket state in the job log.Tests written to fail first (
src/main/browser/cua/admission.test.ts). Thenode:netmock now sees each accepted socket before the server does, and wrapswriteordestroyto readinspect()at the moment the peer could first observe the hello or the close. Before the fix both read 0 (commits 859725c, 15356be); after it, 1. A third test pins the close line's cause for the host's end and for a removed session.Runs
e2e:browser-cuaruns, each7 passedwith no retry and noflaky:line: 40806888425, 40807460959, 40807965478, 40808110234, 40808764645. The case now sits at :499, and its first read is at :510.src/main/org/org-session.test.ts› "a focus whose window is gone by the time Touch ID would ask…",ENOTEMPTYon its temp-directory teardown.[browser-cua witness] …into the job log, with the read, the fake host's socket state and main's[browser]lines (in that run, the new close line from the case's own cleanup).Review
doperpowers:reviewer-medium returned no findings. The reviewer separately reproduced the inspector ordering with a standalone probe.
Left over
leasedafterdebugger.attach) are safe, because the handler records the lease before it returns. The same write-before-bookkeeping shape could exist elsewhere in MAWS wherever an e2e reads main right after a side effect that main makes visible before finishing its own bookkeeping. This change does not audit for it.Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)