Skip to content

Fix blank Mac keyboard predictions - #814

Merged
enaboapps merged 2 commits into
mainfrom
codex/mac-predictions-813
Sep 20, 2026
Merged

enaboapps merged 2 commits into
mainfrom
codex/mac-predictions-813

Conversation

@enaboapps

@enaboapps enaboapps commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Mac keyboard predictions remained blank in TextEdit because the prediction subprocess could not resolve the system-wide focused Accessibility element. In the VM it consistently returned kAXErrorCannotComplete (-25204), despite AXIsProcessTrusted() returning true. The worker now resolves the foreground application's focused element and rejects foreground changes during discovery. Because the pipe-driven worker has no AppKit event loop, it also processes pending foreground notifications with a zero-duration run-loop pass before each PID query. Existing protected-field, context and acceptance validation remains in place.

Transferred debug bundles now prefer their bundled database, retaining the source-tree fallback for unbundled development. Previously they always referenced the build machine's absolute source path.

Closes #813.

Validation:

  • Node 24: lint, 163 frontend tests, 5 script tests and production build passed.
  • Rust 1.97.1: formatting, clippy with warnings denied, 488 unit tests (1 existing ignored), 7 config tests and doc tests passed.
  • Added fake foreground-discovery tests for missing/invalid processes, focus changes and AX failures; file-based tests cover bundled, transferred, missing and development database resolution.
  • Signed development build in the Mac VM: TextEdit I would like wa produced water/watching/walking/washington/war. One Select inserted ter once; subsequent next-word suggestions appeared, manual Next retained the same suggestions, and selecting and inserted it once. TextEdit retained focus. No new Accessibility permission was required. Temporary content-free diagnostics were removed from this change.
  • Final reviewed build e69ae16: repeated the TextEdit prefix completion, closed the disposable document, and compared its saved bytes to exactly I would like water (including one trailing space): passed.
  • Separate VM probe compared long-lived NSWorkspace readers: without event processing the PID stayed at Terminal; a zero-duration default-mode run-loop pass correctly observed Terminal → TextEdit → Terminal. The fix performs this pass before both foreground checks.
  • Restored all three VM configuration files byte-for-byte, closed the task-owned documents, stopped test processes, and returned the VM to its prior suspended state. No permissions changed. Signed local Mac PID 55560 remained untouched; Windows VM was untouched.
  • Independent latest-head review of e69ae16fd57a8c69056a427bdd3247f0b4805da9: no actionable findings. All latest-head CI checks passed, including Mac and Windows native tests and packaging, frontend, dependency audit and CodeQL.

This fixes ordinary Mac context-based predictions independently of the unmerged buffer fallback in #812. No merge or release is included.

Owen McGirr added 2 commits September 20, 2026 20:29
Resolve the focused element through the foreground application, reject focus changes during discovery, and prefer the bundled prediction database in transferred debug builds.
@enaboapps
enaboapps marked this pull request as ready for review September 20, 2026 19:38
@enaboapps enaboapps added this to the v1.0.0-rc.13 milestone Sep 20, 2026
@enaboapps
enaboapps merged commit 1101b4c into main Sep 20, 2026
6 checks passed
@enaboapps
enaboapps deleted the codex/mac-predictions-813 branch September 22, 2026 09:14
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.

Diagnose and verify Mac keyboard predictions in TextEdit

1 participant