Skip to content

Preserve Aqua Voice paste shortcuts through KeyPath - #1331

Merged
malpern merged 1 commit into
masterfrom
fix/aqua-synthetic-paste
Oct 22, 2026
Merged

malpern merged 1 commit into
masterfrom
fix/aqua-synthetic-paste

Conversation

@malpern

@malpern malpern commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Aqua Voice dictation could insert a literal v in ChatGPT while the transcript still appeared in clipboard history. KeyPath's session tap remapped software-generated Cmd+V and rebuilt its flags from physical modifier state, dropping aggregate-only Command. A live AppKit diagnostic on the Air confirmed a Cmd+V sent by the probe arrived as plain V with the KeyPath worker's source PID; the test did not change the clipboard or trigger Aqua Voice Hook.

Pass software keyboard events through unchanged before touching modifier, Caps, held-input, or Kanata state. Hardware input remains mapped, and tap-disabled notifications still reach recovery. Includes focused tests and a durable investigation note.

Validation:

  • Four regression tests passed in an isolated Swift package using the exact production policy and test files: both Cmd+V edges, modifier/Unicode injection, hardware routing, and tap-disable recovery.
  • Accessibility check and SwiftFormat 0.61.1 passed; diff whitespace check passed.
  • Canonical targeted test invocation attempted, but this Air's full build failed before tests because Xcode is missing the Metal Toolchain. Full application tests must pass in CI.
  • Scripts/review-gate.sh attempted; local Claude review could not complete because its session quota is exhausted. GitHub claude-review must pass before merge.
  • Not installed or live-verified after the fix. Installed behavior was reproduced before the fix. Draft pending full CI/review and candidate verification.

@malpern
malpern force-pushed the fix/aqua-synthetic-paste branch from 0153925 to e946ed1 Compare October 22, 2026 05:29
@claude

claude Bot commented Oct 22, 2026

Copy link
Copy Markdown

Review: no blocking issues. The bypass is placed correctly. It runs after the finished and outputTag checks, and .tapDisabled* types return false, so recovery still fires.

Non-blocking notes:

  • Behavior change: every event with a positive source PID now skips Kanata. That includes events from Hammerspoon, Keyboard Maestro, BTT, remote-desktop and accessibility tools, which could previously be remapped. This is probably the right trade-off, but docs/bugs/session-synthetic-paste.md could say so explicitly. It could also mention that tools posting events from a privileged helper, or from a virtual HID driver such as Karabiner, may report PID 0 and still take the remap path.
  • Fragile test: testSoftwarePastePreservesAggregateCommandOnBothEdges asserts that a locally created CGEvent with a private CGEventSource has eventSourceUnixProcessID > 0. That is OS and sandbox behavior, so it could fail on headless CI runners. The other tests set the PID explicitly, which is more robust. Consider setting the PID there too, or using XCTSkip if it is 0.
  • Weak test assertion: the final XCTAssertEqual(event.flags, .maskCommand) checks that the policy function didn't mutate the event. It doesn't exercise the worker callback, so there's no test that the pass-through returns the original event with flags intact. If SessionRuntimeWorker can be tested with a stub, a callback-level test would cover the real regression.

@malpern
malpern marked this pull request as ready for review October 22, 2026 05:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-10-22T05:35:11.822570Z e946ed1 Draft marked ready
ℹ️ 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.

@malpern
malpern merged commit 385df8a into master Oct 22, 2026
11 checks passed
@malpern
malpern deleted the fix/aqua-synthetic-paste branch October 22, 2026 05:43
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