Skip to content

fix(typing): paste into editors that report AXButton - #1112

Open
jeevvansh wants to merge 8 commits into
altic-dev:mainfrom
jeevvansh:fix/1109-focus-delivery-fallback
Open

jeevvansh wants to merge 8 commits into
altic-dev:mainfrom
jeevvansh:fix/1109-focus-delivery-fallback

Conversation

@jeevvansh

@jeevvansh jeevvansh commented Oct 13, 2026 •

Copy link
Copy Markdown

Description

Fix shared macOS dictation delivery after failures observed in Muse and ChatGPT desktop (Codex chat), without an app-specific allowlist.

Allow Reliable Paste for editors reporting AXButton while requiring the captured field and app to remain unchanged. Preserve secure-field, self, missing-focus, and clipboard ownership safeguards.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Fixes #1109

Testing

FluidVoice 1.6.12-beta.1, macOS 27.0 (26A5406e), Apple M1 Max, Xcode 27.0.

Reproduce: click Muse's composer, dictate, then stop. Before: insertion refused. Patched earlier builds inserted successfully. ChatGPT desktop (Codex chat) insertion was verified on f35b88f6 after refreshing permissions. GUI was not repeated after the latest review fixes.

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 27.0
  • Ran linter locally: strict SwiftLint, 560 files, zero violations
  • Ran formatter locally: changed lines, repository configuration
  • Ran tests locally: 48 isolated production-code XCTest methods, zero failures

Regressions failed before the fixes and passed afterward. Debug app/test-target compilation and optimized Release build passed. Tests use fake focus/clipboard/command dependencies. Full app-hosted tests were not rerun due a prior isolation failure; additional GUI checks remain untested.

Screenshots / Video

automated-validation

Earlier validation screenshot; Muse log from the refactored build:

FOCUS_ASSESS notEditable role=AXButton decision=reliablePasteFallback
outcome=inserted

Notes

Codex assisted with implementation, tests, and independent review. I tested Muse and ChatGPT desktop on the revisions above. Existing compiler warnings remain; earlier release-highlights and full-file formatting failures were not rerun.

  • A human created this PR or reviewed and approved it before submission, understands the full diff, and takes responsibility for the change.

Muse reports AXButton for its composer. Use Reliable Paste when the immutable external destination matches live app and PID, while rejecting missing focus, self, secure fields, and destination drift. Recheck queued paste and prevent replay after unsafe partial direct delivery.
Preserve configured insertion mode for safe unknown roles, avoid redundant accessibility reads, and cover the direct refusal latch without changing captured AXButton paste behavior.
Match the existing backup ownership policy before retaining a refused queued transcript. A newer explicit user copy must win over the transcript backup preference. Add a regression covering an active lease, queued delivery, destination change, and intervening clipboard copy.
@jeevvansh
jeevvansh marked this pull request as ready for review October 13, 2026 06:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-14T06:26:39.867776Z 8fd3aa3 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue remains from this review.

Summary

Adds Reliable Paste for editors that report AXButton, while keeping checks for secure fields, missing focus, and FluidVoice itself.

  • Dictation pastes into a captured editor that reports AXButton.
  • Paste delivery waits for focus checks before changing the clipboard.

No new actionable issues were found. The three supplied, unnumbered previous findings are addressed: ordinary insertion supports unbundled apps, repeated typing checks run off the main thread, and delivery checks the captured element rather than only the app.

Review was based on source inspection. Builds and tests were not run.

Reviews (5) · Last reviewed commit: "fix(typing): retain exact delivery focus..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b81dffce75

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b538a09e6f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeevvansh jeevvansh changed the title fix(typing): restore dictation paste into Muse fix(typing): paste into editors that report AXButton Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f35b88f6f6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fd3aa3e19

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +588 to +592
// Once direct typing starts, a role change alone must not replay a partly typed transcript.
guard isOutputValid() else { return false }
return directState.canContinue(
Self.assessDeliveryFocus(observation: observation, capturedTarget: deliveryTarget, preferredTargetPID: preferredTargetPID, expectedFrontmostPID: deliveryFrontmostPID).decision
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat a pre-chunk AXButton transition as fallback

When a web composer is initially .editable but reports AXButton on the next focus read, canContinue leaves wasRefused false and returns true for .reliablePasteFallback. insertTextDirectly invokes this predicate in attemptDirectInsertion and again in postUnicodeChunks before the first event is posted, so this transition can occur with no partial text to protect; the code then posts the direct path, which reports success without knowing whether the editor accepted it, instead of taking the new clipboard fallback. Track whether a chunk has actually been posted and route this preflight case to the paste fallback.

Useful? React with 👍 / 👎.

window: window,
element: element
element: element,
isSecureTextField: DeliveryTargetAssessment.isSecureTextField(element)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Defer secure-field AX reads until capture has stopped

When the focused app has a slow or hung accessibility provider, this call performs the newly added role and subrole queries synchronously on the stop path. ContentView.captureDictationStopSnapshot calls captureRecordingTargetContext() before asr.stop(...), so releasing the dictation hotkey now waits on those remote queries, keeping the microphone running and freezing the stop UI until the AX call times out; retain the element at stop and resolve its secure status off-main after audio capture is stopped, before delivery.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown

This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the keep-open or pinned label to prevent automatic closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] v1.6.11: dictation refuses to paste into the Muse macOS app (focus check reads AXButton); works in Chrome and Gemini

1 participant