Skip to content

macOS global dictation does not paste with Russian keyboard layout #19710

Open

Description

@alexgetmancom

What version of Codex is running?

Codex desktop app: 26.422.30944 (CFBundleVersion 2080)

Bundled CLI inside the app: codex-cli 0.125.0-alpha.3

Homebrew CLI on the same machine: codex-cli 0.118.0

What subscription do you have?

ChatGPT Pro

Which model were you using?

Not model-specific. This happens in the macOS desktop app global dictation feature before any model request is sent.

What platform is your computer?

Darwin 25.4.0 arm64 arm

macOS 26.4.1 (25E253)

Selected input source when reproducing:

InputSourceKind = "Keyboard Layout"
KeyboardLayout Name = Russian
KeyboardLayout ID = 19456

What issue are you seeing?

Codex desktop app global dictation successfully records and transcribes speech, but the recognized text is not inserted into the focused text field when the current macOS keyboard layout is Russian.

The same workflow works when the system keyboard layout is switched to English.

The transcription itself is not failing. New entries are written to ~/.codex/transcription-history.jsonl, and during debugging the transcribed text briefly appears in the macOS clipboard. The failure is specifically the final paste step.

What steps can reproduce the bug?

  1. On macOS, enable the Russian keyboard layout and make it the current input source.
  2. Open Codex desktop app settings and configure global dictation hotkey.
  3. Open TextEdit or Notes.
  4. Click into an editable text field so the insertion point is active.
  5. Hold the Codex global dictation hotkey and say a short phrase.
  6. Release the hotkey.

Actual result: Codex shows the dictation UI and writes the transcript to ~/.codex/transcription-history.jsonl, but no text is pasted into TextEdit/Notes.

  1. Switch the macOS keyboard layout to English.
  2. Repeat the same dictation workflow.

Actual result with English layout: the transcribed text is pasted correctly.

Minimal AppleScript reproduction of the underlying paste issue while Russian layout is active:

-- Does not paste under Russian layout
set the clipboard to "ONLY_KEYSTROKE_V"
tell application "System Events" to keystroke "v" using command down

-- Does paste under Russian layout, because it uses the physical V key
set the clipboard to "ONLY_KEY_CODE_9"
tell application "System Events" to key code 9 using command down

What is the expected behavior?

Global dictation should paste the recognized text into the focused text field regardless of the current macOS keyboard layout.

Additional information

The packaged Codex app appears to use AppleScript equivalent to:

tell application "System Events" to keystroke "v" using command down

That is layout-dependent. With Russian input active, keystroke "v" using command down does not behave as physical Cmd+V, so paste is not delivered.

Changing the paste command to a physical key code fixes the issue locally:

tell application "System Events" to key code 9 using command down

key code 9 is the physical V key on macOS, so command down + key code 9 maps to paste independently of the active keyboard layout.

I verified the diagnosis by monitoring ~/.codex/transcription-history.jsonl and the clipboard during dictation:

  • The transcript is written to history.
  • The transcript briefly appears in the clipboard.
  • Under Russian layout, the simulated Cmd+V does not paste.
  • Under English layout, the same Codex dictation flow pastes successfully.
  • A local binary patch replacing keystroke "v" with key code 9 makes the paste work under Russian layout, but it breaks the app code signature, so it is not a viable user workaround.

Suggested fix: use physical key code based paste on macOS for global dictation, or otherwise use a layout-independent paste mechanism.

Activity

  1. added
    bug
    app
    on Apr 26, 2026
  2. alexgetmancom commented on Apr 26, 2026

    @alexgetmancom
    Author

    I did one more pass to narrow this down to the packaged Desktop code.

    In Codex Desktop 26.422.30944, the global dictation paste path is in the packaged Electron main bundle (app.asar, .vite/build/main-*.js). The relevant flow is:

    • write transcript to Electron clipboard
    • wait briefly
    • call the macOS paste helper
    • restore the previous clipboard if it still contains the transcript

    The macOS paste helper currently shells out to osascript and sends paste with a layout-dependent AppleScript command:

    - tell application "System Events" to keystroke "v" using command down
    + tell application "System Events" to key code 9 using command down

    key code 9 is the physical V key on macOS. This makes Cmd+V work regardless of the active keyboard layout, and I verified locally that it fixes Russian layout paste.

    I also cloned the public openai/codex repo at current main and could not find this Desktop source string there. The public repo appears to contain the CLI/Desktop launcher, while this paste implementation is only present in the packaged Electron app. So I cannot submit a direct PR against the public source for this specific line unless the Desktop source is published or mapped into this repo.

    Suggested internal source-level change: in the macOS branch of the global dictation paste helper, replace the System Events keystroke "v" using command down call with key code 9 using command down.

  3. Samburskoy commented on May 1, 2026

    @Samburskoy

    We are seeing the same issue on Codex Desktop 26.429.20946 on macOS.

    Global dictation successfully records/transcribes, and the relevant macOS permissions are enabled (Accessibility, Input Monitoring, Microphone, Screen Recording, and Automation -> Codex -> System Events). However, with a Russian keyboard layout active, the transcript is not pasted into Discord, Notes, or TextEdit.

    After switching the input source to ABC/English, the behavior is consistent with the diagnosis above: the failure appears to be the layout-dependent System Events paste step rather than transcription or permissions.

    So this reproduces on the latest Codex Desktop version as well.

  4. m13v commented on May 3, 2026

    @m13v

    the keystroke-based-on-character pattern is a layout trap on macOS. AppleScript's keystroke "v" resolves to whatever key produces 'v' under the current input source, which on Russian or Dvorak isn't kVK_ANSI_V. key code 9 + cmd works because it's the physical V slot regardless of layout. cleaner fix is dropping System Events entirely: CGEventCreateKeyboardEvent with kVK_ANSI_V hits the same path without the AppleScript bridge. or skip simulated Cmd+V altogether and write to the focused element via AXUIElementSetAttributeValue on kAXSelectedTextAttribute, no clipboard race, no layout coupling.

  5. MumuTW commented on Jun 18, 2026

    @MumuTW

    I can confirm this is still reproducible in a newer Codex Desktop build, and it also affects Zhuyin, not only Russian layouts.

    Environment:

    • Codex Desktop: 26.611.62324
    • macOS: 26.5.1
    • Input source: com.apple.inputmethod.TCIM.Zhuyin / ZhuyinBopomofo

    Behavior:

    • Global dictation starts normally.
    • Transcription works.
    • The transcript appears in the global dictation UI/history.
    • Dictation works inside the Codex app.
    • But when the focused target is an external app such as TextEdit/Notes, the transcript is not inserted.

    I verified locally that this is still the same layout-dependent paste issue. Before patching, the packaged app still contained:

    tell application "System Events" to keystroke "v" using command down

    Under Zhuyin, this does not reliably send physical Cmd+V, so the paste step silently fails.

    Local workaround that fixed it:

    I patched /Applications/Codex.app/Contents/Resources/app.asar and replaced the AppleScript paste command with:

    tell application "System Events" to key code 9 using command down

    After fully quitting and restarting Codex, global dictation insertion into external apps started working under Zhuyin.

    This confirms the issue is not microphone permissions, Accessibility permissions, or transcription. It is still the layout-dependent paste implementation.

    Note: this workaround modifies the signed app bundle and will be overwritten by updates, so it is not a viable user-facing fix.

    Suggested fix:
    Use key code 9 using command down, CGEvent with kVK_ANSI_V, or another layout-independent paste mechanism for macOS global dictation.

  6. suregoodru commented on Jul 1, 2026

    @suregoodru

    I can confirm this issue as well.

    In my case, Codex global dictation works correctly when the current macOS keyboard layout is English, but fails to paste the recognized text when the current layout is Russian.

    What I observe:

    • I use Codex global dictation with Right Option as the hotkey.
    • With English layout active, the dictated text is transcribed and pasted into the focused text field correctly.
    • With Russian layout active, Codex appears to record and transcribe the speech, but the final paste step fails.
    • The recognized text can still be found in Codex transcription history/settings, so this does not look like a speech recognition problem.
    • The issue reproduces in external apps/text fields, not only in one specific app.

    This makes the feature unreliable for users who regularly switch between English and Russian layouts. Manually switching to English before every dictation is not a practical workaround.

    The diagnosis in the original issue looks correct to me: the final paste action should be layout-independent on macOS. Using a physical key code for paste, or another layout-independent paste mechanism, would likely fix this without requiring users to change keyboard layout or install external automation tools.

    Please prioritize this fix, since global dictation is otherwise very useful but currently unreliable for multilingual macOS users.
    Codex version: 26.623.81905 • Released Jul 1, 2026
    macOS version: 26.5.1 (25F80)

  7. MumuTW commented on Jul 1, 2026

    @MumuTW

    Still reproducible after another Codex Desktop update, and the local binary patch is still required.

    Clarification: although the issue title mentions Russian, this is not specific to Russian text or the Russian keyboard layout. The underlying failure is the layout-dependent macOS paste simulation. Zhuyin/Bopomofo reproduces the same problem because keystroke "v" using command down depends on the active input source. A more accurate scope would be non-US/non-ABC keyboard layouts or input sources.

    Environment:

    • Codex Desktop: 26.623.81905, CFBundleVersion 4598
    • macOS input source: com.apple.keylayout.ZhuyinBopomofo
    • App path: /Applications/Codex.app

    Observed:

    • Global dictation records/transcribes successfully.
    • The transcript is available, but final paste into the focused external app fails when Zhuyin is active.
    • Switching layout avoids the issue, consistent with the existing layout-dependent paste diagnosis.

    I inspected the updated app bundle and confirmed the packaged app still contains:

    tell application "System Events" to keystroke "v" using command down

    After replacing it locally with the layout-independent equivalent:

    tell application "System Events" to key code 9 using command down

    the bundle contains old_count=0 and new_count=1, and the replacement AppleScript compiles successfully with osacompile_exit=0.

    This is the same workaround as before, but Codex updates overwrite it and it also breaks the app code signature, so it is not a viable user workaround.

    Expected fix:

    Use a layout-independent paste mechanism for macOS global dictation, e.g. physical key code paste / CGEvent with kVK_ANSI_V, or another non-layout-dependent insertion path.

  8. MumuTW commented on Jul 3, 2026

    @MumuTW

    I’d like to clarify the scope here: this does not appear to be Russian-specific.

    This is likely affecting many non-ABC / non-US macOS keyboard layouts and input sources. I can reproduce the same failure with Zhuyin/Bopomofo, and others have confirmed Russian as well. The common factor is not the spoken language or transcription result, but the final paste step being layout-dependent.

    Current behavior appears to rely on:

    tell application "System Events" to keystroke "v" using command down

    On macOS, this is interpreted through the active keyboard layout/input source. Under non-English layouts, it may not produce the physical Cmd+V paste shortcut, so the transcription succeeds but insertion into the focused external app silently fails.

    A layout-independent implementation fixes this locally:

    tell application "System Events" to key code 9 using command down

    or equivalently a CGEvent-based paste using the physical kVK_ANSI_V key.

    I think this should probably be treated as an internationalization/accessibility bug rather than a Russian-layout edge case, because global dictation is effectively unreliable for multilingual macOS users unless they manually switch to English before every dictation.

  9. Neutize commented on Aug 10, 2026

    @Neutize

    Still reproducible on ChatGPT/Codex Desktop 26.803.41515 (build 6321), macOS 26.5.2 (25F84), Apple Silicon, with the RussianWin input source (keyboard layout ID 19458).

    Global dictation inserts the transcript into external apps when the English layout is active, but the final insertion fails with RussianWin. The transcript remains available in Codex transcription history, so transcription itself succeeds.

    I also checked the currently packaged app.asar. It still contains:

    tell application "System Events" to keystroke "v" using command down

    The layout-independent key code 9 using command down implementation is absent. This appears to be the same layout-dependent paste path described in the original report.

  10. nottengame commented on Oct 30, 2026

    @nottengame

    Still reproducible on 2026-10-30 with desktop app 26.1023.51421 (build 22530) on macOS 26.5.1.

    Configuration: global hold-to-dictate on Right Option; Main language explicitly set to English; macOS input sources ABC and Russian.

    Current reproduction

    1. Focus Telegram's message input with Russian selected.
    2. Hold Right Option, dictate in English, then release.
    3. Recognition succeeds: the correct English transcript appears under Recent recordings.
    4. The floating recording chip disappears, but nothing is inserted. There is no visible insertion error or Copy/Retry recovery action on that chip.
    5. With ABC selected, the same global dictation workflow inserts successfully. In-app dictation also works with Russian selected.

    Timing evidence from the affected user

    • Manually pressing Cmd+V immediately after dictation finishes can insert the new transcript.
    • Waiting even briefly before using Cmd+V or context-menu Paste instead inserts the previous clipboard contents.

    This makes the transient transcript/clipboard restoration observable without changing the installed app. The disappearing chip has no copy control; navigating back into recording history is an interruption, especially after a long dictation.

    Read-only implementation inspection of this build
    The cross-app path saves the nonempty transcript to history, snapshots the clipboard, writes the transcript, attempts Paste, waits approximately 700 ms, and restores the previous clipboard if it has not otherwise changed. It treats the paste API's completion as success without confirming insertion. The macOS path first attempts an Accessibility menu Paste; if that throws, its fallback simulates Command plus the literal letter v. This report does not establish which branch Telegram used, but the layout-dependent fallback remains consistent with the original report.

    Impact / expected behaviour
    A bilingual user may be typing Russian, then start an English dictation without noticing the current keyboard layout. Recording and recognition appear to succeed, yet an arbitrarily long message is silently left out of the target app. Global dictation should insert independently of the keyboard layout.

    If insertion cannot be confirmed, please keep a visible recovery chip with Copy/Retry and preserve the transcript for manual paste. The affected user's proposed interim mitigation is a configurable 5–10 second clipboard-restoration grace period, rather than approximately 700 ms, so recovery is possible without a split-second race. A longer delay is a mitigation; layout-independent insertion remains the actual fix.

    No audio, raw logs, conversation history, account identifiers or user-specific filesystem paths are attached. The installed application was not modified.

  11. smeshny commented on Nov 24, 2026

    @smeshny

    This issue is still affecting global dictation on ChatGPT/Codex Desktop 26.1120.41243 (build 30607) on macOS 27.2.1. The configured shortcut is Left Option, and the input sources are ABC and the standard macOS Russian layout.

    Steps to reproduce

    1. Focus an editable text field and select the Russian keyboard layout.
    2. Hold the global dictation shortcut, say a short phrase, and release it.
    3. Wait for dictation to finish. The dictated text does not appear in the focused field.
    4. Switch to ABC and repeat with the same field, shortcut, and spoken language. The text appears in the field.

    What is still present in this build

    A read-only inspection of the installed app bundle shows that the macOS insertion code first tries to invoke the foreground app's Paste menu item through Accessibility. If that call throws, it falls back to the following AppleScript command:

    tell application "System Events" to keystroke "v" using command down

    The fallback sends a character-based shortcut, which can fail to deliver Paste with a non-Latin input source. Earlier reports in this issue confirmed that recognition can complete and save a transcript while the target field stays empty. In this report, the confirmed observation is the difference in text insertion between Russian and ABC. The runtime branch taken by the target field has yet to be verified.

    Suggested fix and regression test

    Keep the Accessibility menu path and make the fallback use the physical V key (kVK_ANSI_V, key code 9):

    tell application "System Events" to key code 9 using command down

    The replacement compiles with osacompile, and the original report confirms that it restores insertion under the Russian layout. For a regression test, exercise the fallback with both ABC and Russian active and verify that the completed transcript is inserted into the focused field in both cases. A successful AppleScript exit alone can miss the insertion failure.

  12. smeshny commented on Nov 24, 2026

    @smeshny

    Interim workaround for build 30607: a small macOS menu bar helper detects the Codex global dictation overlay using window metadata. When the overlay opens with the Russian layout active, the helper switches to ABC. It restores Russian two seconds after the overlay closes, giving Codex time to paste under ABC.

    The helper runs separately from Codex. The switch-and-restore sequence was verified with a test window. Using the physical V key code in the macOS paste fallback would fix this in Codex itself.

    Having to build a separate macOS app in 2026 just to make dictation paste work with a standard keyboard layout is absurd. That’s a serious usability failure for a basic input feature, and it should be fixed in Codex itself.

  13. bmpolonsky commented on Nov 25, 2026

    @bmpolonsky

    Still reproducible on ChatGPT desktop 26.1120.50957 (build 30866), macOS 27.2.1. In the Steam Store search field, global dictation transcribes the same phrase with both Russian and ABC keyboard layouts, but inserts the text only with ABC. Manual Cmd+V and Edit → Paste both work in that field. During the failed attempt, ChatGPT used the System Events fallback, and macOS allowed it to post the key event. This build still uses keystroke "v" using command down for that fallback. Please verify that the transcript actually appears in the target field under both layouts.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions