Skip to content

Hosted flakes: case (h)'s quit before its shells ran, newChatIn's early return; the pin's focus and case (j)'s slow quit self-diagnosing - #495

Merged
SSFSKIM merged 9 commits into
masterfrom
fix/hosted-flakes-1106
Nov 6, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Two recurring hosted-Mac flakes from CI-opt's 2026-11-06 collection (docs/tech-debt-tracker.md, the two 2026-11-06 rows). Each turned out to be two signatures. Two of the four are fixed, each cause shown red first. The other two stay open: the pin's cause is not found, and case (j)'s stall is located in Electron's teardown but not named. Both now print their own diagnosis on their next red. Test and test-support code only: no product change, because none of the four is a product bug as far as the evidence goes.

The quit guard's 1 mid-turn, not asked (e2e:supervisor-daemon)

Not a guard miscount. Each failing case starts a turn and waits for its permission request before quitting, so one session really is mid-turn. On the daemon shape the guard asks about unsaved files alone and only logs not asked: they outlive the app, so it cannot refuse a person's ⌘Q for a session at all.

  • Case (h), the line without its terminals clause (runs 41358368598, 41550088326): a test race, fixed. The case wrote a command to the session's shell, spawned a writer shell with another, and quit at once. A command runs only once its shell reads it, and the quit's report takes milliseconds, so the report counted whichever shell had started. The guard reported truthfully. The case now polls pty.foreground (the probe the guard asks) for both shells before quitting, and asserts 2 busy terminals. Probe run 42151919477, ten repeats each: old timing 9/10 1 busy terminal, 1/10 2; fixed 10/10 2 busy terminals.
  • Case (j), MAWS did not quit within 20 s after the guard's line (run 41995538110): the condition is found, the exact wait is not, and it sits below MAWS's code. Unloaded, 39 timed quits on hosted Macs ended in 0.2 to 0.6 s (probe run 42152465959). Under a busy loop per core, every test cleanup's close stalled past 30 s: 51 of 51 across runs 42163556536, 42165958162, 42167606514, 42169676515 and 42169762260. In each one the guard's report answered in milliseconds, the window's closed came, and Electron never emitted will-quit: MAWS's first will-quit step never started, and main's thread waited in a nested run loop. powerSaveBlocker's prevent-app-suspension changed nothing. (j)'s own red got further, to Node's wait for the inspector, so its stall came after the main loop. Both stalls are in Electron's or Chromium's teardown. Naming the wait needs Electron 44.4.5's symbols for the sample, which I would call a separate investigation rather than a flake fix. Scratch.quit now names, on that red, when main's report, the guard's line and Node's wait for the inspector arrived, and leaves a sample of the stuck process in the test's output.

presentations-comments.spec.ts:248 (e2e:presentations, packaged 2/2)

  • The library's row not found within 30 s (run 41001502230): a test race, fixed. The project row's + creates the session over a round trip to main and only then opens its tab, selected; newChatIn returned at the click. The library's tab then opened first and the chat's took the selection (the red's snapshot: tabs Artifacts, New chat selected, the composer focused). Red first: under a busy loop per core, master's helper returned before its tab in 18 of 22 calls and reproduced the red with the same snapshot (probe run 42155530599). newChatIn now waits until a session tab that was not open before the click is the selected one; under the same load the fixed helper waited up to 1.07 s for it (probe run 42158782127; that run's cases then stalled in their cleanup, the close stall under case (j), so it shows the wait, not a green set).
  • The pin not focused after the press on the empty stage (runs 41115599211, 41353381610, 41494976905, 42013363487): cause not found. It reproduced once, on master's case under a busy loop per core with the whole file x6 (run 42167606514, 1 of 6 pin runs, untraced). Traced, it never reproduced in 125 runs: plain x40, packaged x15, a 4x renderer CPU throttle x30, a busy loop per core x40 (runs 42151699071, 42153035201, 42155113914, 42169676515). In every passing trace the popover's press handler focuses the pin and nothing moves it after. The reds came in slow packaged shards (the file's first case 12.6 to 13.8 s against 6 to 11 s elsewhere). The case now prints, when that assertion fails, the element under the press point and every focus change with each focus() caller's stack (e2e/support/focus-trace.ts).

Gates on the head

Run 42162041741 on ed6db17, all green with no flaky line: static; e2e:presentations (38 passed); packaged 1/2 and 2/2 (98 and 120 passed, the pin case among them); e2e:supervisor-daemon (21 passed); and, since newChatIn serves other specs, e2e:default (142), e2e:design (19), e2e:side (12), e2e:library (7) and e2e:remote (4). ed6db17 carries all of the code, including the fix for the review's one finding (quit markers split across output chunks) and for an earlier static red (42158906347, a NamedNodeMap spread without DOM iterables); the two commits after it change only the tracker rows.

Left over

  • The pin's cause and case (j)'s cause stay open in their tracker rows, each closing on the next red's own diagnosis or ten consecutive greens.
  • Product observation, not changed here: a New chat tab opened late (after session.create answers) takes the selection from a tab the person opened meanwhile. Only a click within that round trip meets it.
  • Case (j)'s stall in Electron's teardown under CPU contention (above): whether to chase it with symbols, or guard the quit's tail, for example a watchdog that exits once the last window has closed and will-quit has not come. A person meets it only when quitting with the CPU saturated, and after their windows are gone; a relaunch during the stall is the case worth knowing about.
  • Under the same load, every test cleanup's app.close() stalls, so a heavily loaded hosted Mac can turn any e2e case red in its afterEach.

Board #473's branch (fix/473-handover-inflight) has no commits of its own yet; nothing here touches the handover or the quit guard's code.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…, so the guard's report names both terminals

The case wrote a command to the session's shell and spawned a writer shell with another, then quit at once. A command runs only once its shell reads it, and the quit's report takes milliseconds, so the report counted whichever shell had started: one in 9 of 10 hosted runs at the old timing, and in two CI runs none, which left the line without its terminals clause (runs 41358368598, 41550088326). The guard reported truthfully; the test quit before its own precondition held. It now polls pty.foreground (the probe the guard asks) for both shells before the quit, asserts 2 busy terminals (or terminals unknown), and gives the commands 8 s so their output still lands after the quit. Probe run 42151919477: old timing 9/10 '1 busy terminal', fixed 10/10 '2 busy terminals'.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…d leaves the process's stacks

Run 41995538110's case (j) failed with 'MAWS did not quit' and the guard's line alone: the guard had not asked (on the daemon shape nothing is) and had called the final quit, and nothing said where the next 20 s went. 39 quits timed on hosted Macs (probe run 42152465959) all ended in 0.2 to 0.6 s, so this was a 30-fold outlier no probe reproduced. The bound's message now names when main's report, the guard's line and Node's wait for the inspector to detach arrived (the last comes once Electron's main loop has ended), and a 2 s sample of the stuck process lands in the test's output.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…d one

The project row's + makes the session over a round trip to main and only then opens its tab, selected. newChatIn returned at the click, so a step right after it could open its own tab first and lose it to the chat's: presentations-comments.spec.ts:248 on 2026-10-30 (run 41001502230) clicked the library's Artifacts, whose tab opened, then the New chat tab opened after it and took the selection (the failure's snapshot: tabs Artifacts, New chat selected, the composer focused), and the library's row was never visible. The helper now waits for a selected session tab that was not open before the click.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…er the empty-stage press prints where the press landed and where the keyboard went

Four hosted reds since 2026-10-30 (runs 41115599211, 41353381610, 41494976905, 42013363487) found the popover closed, the body still selected, no marquee and the pin not focused, with nothing to say what took the keyboard. 109 traced probe runs reproduced none (plain x40, packaged x15, a 4x renderer CPU throttle x30, a busy loop per core x24; runs 42151699071, 42153035201, 42155113914), and the reds came in slow packaged shards (the file's first case 12.6 to 13.8 s against 6 to 11 s). e2e/support/focus-trace.ts records focus changes, focus() and blur() callers, presses and the pin's node frame by frame; the case prints that record with the element at the press point when the assertion fails.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…wo of four signatures fixed (newChatIn's early return, case (h)'s quit before its shells ran); the pin's focus and case (j)'s slow quit not reproduced, each now printing its own diagnosis on a red

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…he e2e lib has no DOM iterables (static gate 42158906347)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…ch stream kept separate

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T05:03:50.141347Z ed6db17 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.

…dition reproduces: a loaded close stalls in Electron's teardown after the window closes, before will-quit

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Sminos-Session: GUI AI agent workspace charter#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