Repository navigation
Description
Problem & intent
On the Mac mini, the owner's Chrome "Profile 1" window, the only window of the resident Chrome (pid 36513), closed on its own twice in two days. Each time it followed a run in which the native computer-use helper typed into TextEdit:
- the window had closed by 06:30Z on 2026-10-18; the last run before that was the accept-native sitting at 03:15Z, which types into TextEdit;
- it closed between 15:43Z and 15:48Z on 2026-10-18, during native-baseline's vendor computer task set, which sends super+n ×2, typeText ×10, super+w ×10 and super+q ×1 to a TextEdit document the run opened itself.
Nobody was at the mini either time. The HID idle time puts the last input at the run's own final super+q. The browser runs in the same window can't reach that Chrome. AX confirmed every expected TextEdit close, but it can't show where any other key went. So the leading hypothesis is that a modifier key event (super+w, possibly super+q) reached whichever app held key focus at that instant, rather than the app the session is bound to. If true, a cua computer session could close or quit another app's window during normal use, the owner's included. super+q landing in Chrome would quit it.
The evidence is correlation, not a proven mechanism. The intent: establish how the helper posts key events (to the bound app's pid, or globally to the focused app), and if they can land elsewhere, make cua never deliver a key to an app other than the one the call names.
What to do
- Investigate, without risking the owner's apps. Use a scratch macOS user or the CI hosted runner's GUI session where possible, or on the mini a sacrificial app in front instead of Chrome. Find out how the vendor helper (Codex Computer Use) delivers pressKey and typeText: whether it posts to a pid or globally, and what happens when the bound app loses key focus mid-sequence. Use the logs, an event tap that observes without modifying, and the frontmost-app timeline.
- If keys can land elsewhere, add a guard in cua's API layer: check the frontmost app or the key window's owner against the bound app immediately before each key event, and refuse the call (a classified error) rather than send it. Or route keys to the pid, if the helper offers that. This touches Independence 4: cua's own native accessibility engine (replace sky) measured against a native baseline #117's goals: the driven window must not jump forward, and driving must stay off other apps.
- Until that's resolved, harnesses that send super+w or super+q on the mini do so only with no owner app window open, or they check the frontmost app before each such key.
Success criteria
- A written finding on how the helper routes keys, with the reproduction or its absence.
- If keys can misroute: a cua call that would send a key while the bound app isn't frontmost refuses with a classified error, pinned by a test with a stub helper.
Constraints
Never quit or kill the owner's Chrome or other apps; never automate permission dialogs; synthetic secrets only.
Activity
Harness guard for #162: native-baseline's task, close and quit cells …
Own sandbox spec: macOS acceptance 11 accepted on three runs; the fro…
SSFSKIM commentedon Oct 18, 2026
[board] in-design: Taken by the cua coordinator: a static investigation of the key-delivery path (cua API → vendor JS → native helper symbols) is running, with no GUI or input. Its findings decide whether a live experiment is needed.
SSFSKIM commentedon Oct 18, 2026
Static finding (read-only; nothing executed, no GUI, no helper launched): the helper posts keys to the bound app's pid, not to whichever app has focus.
Delivery path:
pressKey/typeTextcallsky.press_key({app, key})/sky.type_text({app, text})(src/cua-api/bind-mac-app.mjs:55, :76) and go through the trusted service unchanged (src/services/sky.mjs). Only the app string travels.@oai/sky0.7.5):withComputerUsePolicyresolves the app to the approved app's path.client.pressKeysends aComputerUseIPCAppPerformActionRequest {app:<path>, action:{pressKey|type}}over the helper's socket.SkyComputerUseService, not stripped):NSWorkspace.resolveApplicationTarget(for:)). ThenComputerUseAppController.performKeyboardActiongets the target fromApplicationUIElement.targetForKeyboardEvent(), aKeyboardEventTarget{pid, element}holding the bound app's pid. The one exception is an out-of-process focused element, which is accepted only when its AX parent chain ties it to the bound app.SynthesizedEvent.send(to: pid, delay:), which only ever callsCGEventAPI.postToPid, by cross-reference.CGEventAPI.post(_:tap:)has two callers, both inSystemLockScreenController: ctrl+cmd+Q to lock the screen, and typing the lock-screen password.activateWithOptions:is reached only from the click path (syntheticallyActivateIfNeededForSendingClick), never the keyboard path.The closures don't fit the key path:
IOPMAssertionDeclareUserActivity("Codex Computer Use interaction")for every request, which resets HID idle without any HID-level key.Static analysis can't settle:
postToPidresolves to (CGEventPostToPid or SkyLight's equivalent, by name and signature);The Open-panel measurement is evidence against rerouting.
Decision:
handleRpcin src/services/sky.mjs onexecuteforpress_key/type_text/paste, with a frontmost read from the supervisor (thenodeRepl.launchServicesprecedent). It refuses with a classified error, pinned by a stub-helper test.Next: find what did close the window. A read-only timeline of Profile 1's window and tab closes from Chrome's
Sessions/files (timestamps and command types only, no URLs or titles), lined up against cua's tab operations and every run on the mini at those times. A live decoy-app experiment runs only if a close lines up with a super+w to the second.SSFSKIM commentedon Oct 18, 2026
Both closures were close-button clicks that came in over Screen Sharing. cua and the helper's keys were not involved.
Closure 1, 2026-10-18 03:14:43Z.
trackMouse send action on mouseUpat 03:14:43.572Z, thenwindowShouldCloseat .578Z.front=com.google.Chrome(m1 sitting-log lines 1444–1456).Closure 2, 2026-10-18 15:31:52.737Z (not 15:43–15:48Z as first recorded).
native port closed (end)at 15:31:52.806Z, which is the profile unloading. The host's last cua session had ended at 07:02:21Z.waitForTimeoutloop and sent no OS input. No cua session or helper activity appears at either second.Side findings:
remote=noneat 15:28:41Z and 15:32:07Z (~/Library/Logs/ci-kit/mac-runner-hooks.log) while that viewer was attached. Passed to CI-opt.keepWindow) lets a close go ahead after its 2 s wait, or whentabs.createis refused. That is deliberate, as its comment says, and it was not involved here.To re-read while the log lasts (mini; zsh shadows
log, times in KST):/usr/bin/log show --start "2026-10-18 12:00:00" --end "2026-10-19 02:40:00" --predicate 'process == "Google Chrome" AND (eventMessage CONTAINS "windowShouldClose" OR eventMessage CONTAINS "trackMouse send action")' --style compactRecords corrected in #164.
Merge pull request #164 from SSFSKIM/docs/162-closure-finding
#235 M3 task review: every scene cell goes only while its target is t…