Repository navigation
macOS engine: keys reach remote-view panels (Open/Save) through the vendor's owner walk (#582) - #584
Merged
Merged
Conversation
…tualPid, engine 0.2.1 (refs #582) keyboardTarget walked nothing: it posted to the focused element's public AXUIElementGetPid, which inside an Open or Save panel (openAndSavePanelService) is the app's pid, so the panel never got press_key's, type_text's or paste's keys. Ruling 1202 takes the vendor's route (targetForKeyboardEvent -> outOfProcessTarget -> ProcessType.containingElement): from the focused element up its AXParent chain (the element and 300 parents), each element's actual pid is read with the private _AXUIElementGetActualPid, resolved with dlsym; unread pids and processes with no finished-launching running application are passed over; the first that classifies ends the walk, and its pid becomes the keys' target only when its activation policy is prohibited and it is not the app's. Otherwise the target is main's. Without the symbol no walk is made and status.actualPid reads false. The engine reads through KeyTargetReads, which the tests replace (a fake tree, the symbol forced missing). Activation and refusal stay the bound app's; only the posted pid moves. Sminos-Session: cursor235#b93055dd (cua on macbook)
…d warns when _AXUIElementGetActualPid is unavailable (refs #582) Reads the engine's status.actualPid: true adds that keys reach Open and Save panels, false warns that they go to the app and do nothing there; an engine older than the field, or one that is not the approved bundle, adds nothing. The report carries actualPid. Sminos-Session: cursor235#b93055dd (cua on macbook)
… §5.7's decoded walk (refs #582) Sminos-Session: cursor235#b93055dd (cua on macbook)
…refs #582) Sminos-Session: cursor235#b93055dd (cua on macbook)
…alk has a 250 ms budget, late keys are refused (refs #582) Ruling 1206 on the review of 0d4c599..4b48955. (P1) press_key, type_text and paste read the keys' process before their activation, which can move focus between a document and its Open or Save panel. Each now reads twice: the early read only refuses a forbidden process before anything is touched; finalKeyTarget, after the activation and as the last step before the poster (inside the paste lock, after the paste's activation, before the pasteboard), names the process the keys go to, is refused when forbidden and is driven by the detector. The activation stays the app's. The vendor reads once, after its activation (performKeyboardAction awaits the enforcer, then calls targetForKeyboardEvent at 0x100077934). (P2) The walk stops before a parent read once keyTargetWalkBudgetMs (250 ms) or the request's deadline is spent, gives each read the time left as its messaging timeout, and never reads a parent it would not inspect. Every key route refuses a request past its deadline just before its first key (timeoutReached, nothing sent). (P3) Resolution is tested through an injected function; the live reads are checked against dlsym, present or absent; the presence canary runs only on GitHub's hosted runner. Sminos-Session: cursor235#b93055dd (cua on macbook)
…rder and the walk's budget (refs #582) Sminos-Session: cursor235#b93055dd (cua on macbook)
… the deadline at its first key, a cut-off walk adds a notice (refs #582) Ruling 1207 on the re-review of 4b48955..fe8912c. - P1: earlyKeyTarget drives the early owner again, so a person's key into the panel during the paste lock's wait or the activation stops the action; the final read drives its own, and only it gets the keys. - P2: runPaste runs beforeFirstKey just before its first key event, after the snapshot, baseline, write and key-focus read: past the deadline it refuses and restores the pasteboard. - P3: type_text's paste route reuses the early read's pid; the symbol canary keys on RUNNER_ENVIRONMENT=github-hosted. - The design's request: a final read whose walk stopped at its 250 ms budget marks keyTargetCutOff, and press_key, type_text and paste append a notice to the reply's note. The service now passes press_key's note into the tool result's text. Sminos-Session: cursor235#b93055dd (cua on macbook)
… cut-off notice (refs #582) Sminos-Session: cursor235#b93055dd (cua on macbook)
…refs #582) Ruling 1208: the Linux engine's 0.4.5 pull request takes 0.29.21 and lands first. Sminos-Session: cursor235#b93055dd (cua on macbook)
…e and reaches errors after a post (refs #582) Ruling 1210 on the re-review of fe8912c..69bdbfa. No routing changes: the pid the walk answers, the final read and the post's pid are as on 69bdbfa. - A parent read that answers nothing once the walk's time is spent is told as a cut-off, not the chain's end. - The notice names the public owner the keys went to: the app by name, else the owner's localized name, bundle id or pid. It is short (134 characters for TextEdit) and comes before the method's note, so the password field's note and the notice fit the service's 500 whole. - The notice is given only once keys were posted: in a success's note, and after the sentence of an error after the post. The meta carries keyTargetCutOff {pid}, and the service passes it as cua/keyTargetCutOff. Sminos-Session: cursor235#b93055dd (cua on macbook)
…he paste's deliver read past the deadline (refs #582) Sminos-Session: cursor235#b93055dd (cua on macbook)
Sminos-Session: cursor235#b93055dd (cua on macbook)
Codex Review Summary: ✅ CompletedThis 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. |
Sminos-Session: cursor235#b93055dd (cua on macbook) # Conflicts: # .claude-plugin/marketplace.json # .claude-plugin/plugin.json # tech-debt-tracker.md
SSFSKIM
added a commit
that referenced
this pull request
Nov 24, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 24, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 24, 2026
…d 0.30.0 has its name The version takes T1's 0.30.0 over main's 0.29.22 (#584); the coordinator allocates the final number at merge. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
Closes #582.
What changes
cua's macOS engine now delivers keys to remote-view panels (the Open and Save panels drawn by
openAndSavePanelService), as the vendor's engine does. Before this change, press_key, type_text and paste posted to the public owner of the focused element (AXUIElementGetPid), which for a panel is the host app. The keys landed in the document, not the panel. C-3's key-route diagnostic showed this live (run 45339840861): the vendor's Escape closed the Open panel and cua's did nothing.The engine now follows the vendor's route, which ruling 1202 adopted and which was decoded from the pinned SkyComputerUseService:
_AXUIElementGetActualPid, resolved through dlsym. An unread or unknown owner is skipped. The first owner that classifies ends the walk.Ordering, safety and budget (review rounds 2 and 3)
targetForKeyboardEventafter its focus enforcer. The final read decides the pid the keys go to, is checked against the forbidden list, and is registered too. In paste it runs inside the paste lock.timeoutReached). Paste also checks again at its first ⌘V or Return, after the clipboard snapshot, the baseline and the pasteboard write. There it refuses withkeysDeadlinePassedand restores the pasteboard.<destination>is the app's name when the owner is the app; otherwise the owner process's localized name, its bundle id, orprocess <pid>. The notice comes before the method's own note, so a cut at the service's 500-character limit falls on that note, not on the notice. It also follows an error raised after the post (e.g. typeUnconfirmed), and never accompanies a refusal before any key. The meta carriescua/keyTargetCutOff.Fallback when the private symbol is missing
If
_AXUIElementGetActualPiddoesn't resolve, no walk is made and keys post exactly as before. The enginestatuscarriesactualPid: true|false.cua doctor's engine row says keys reach remote-view panels when it is true, and warns when it is false. Tests force the symbol to be missing.#538 and #258
Only the pid the keys are posted to moves. #538's frontmost refusal applies to pointer events only, and #258's frontmost carrier to clicks only. Neither is touched. The panel service is never activated: its prohibited policy rules that out, and the vendor never tries. A paste test pins this down: the keys go to the service and the activation's events to the app.
Versions
engineVersion 0.2.0 → 0.2.1; plugin 0.29.22 (ruling 1208: the Linux engine's 0.4.5 PR takes 0.29.21).
Verification
finalKeyTargetitself is tested.Reviews
reviewer-high, three rounds:
Unresolved Review Findings
Sminos-Session: cursor235#b93055dd (cua on macbook)