Codex Desktop composer caret/input focus intermittently disappears on macOS until app focus is switched
What version of the Codex App are you using?
Codex Desktop 26.527.31326 (CFBundleVersion 3390)
Bundle identifier: com.openai.codex
What subscription do you have?
ChatGPT Pro
What platform is your computer?
macOS 26.5 build 25F71
arm64
What issue are you seeing?
The Codex Desktop composer intermittently loses its visible text caret / input focus. When this happens, the prompt input area no longer shows the insertion caret and typing focus appears lost.
Switching focus away to another macOS application and then switching back to Codex restores the caret/input focus immediately.
This looks like a Codex Desktop window/text-input focus issue rather than a workspace, prompt, or project-specific issue. It has been observed in the current macOS desktop app, not in user project code.
What steps can reproduce the bug?
The exact trigger is intermittent, but the observed pattern is:
- Use Codex Desktop on macOS normally in a thread.
- After some UI interaction / elapsed time, the composer caret disappears or input focus becomes unreliable.
- Switch to another macOS app.
- Switch back to Codex.
- The composer caret/input focus returns.
Actual behavior
The composer caret/input focus can disappear while Codex remains open and otherwise responsive. The recovery action is to switch away from Codex and back.
Expected behavior
The composer should keep or restore text input focus reliably when the Codex window is active, without requiring the user to switch to another app and back.
Diagnostics / additional information
Recent local macOS unified logs around the event show AppKit and TextInputUI activity inside the Codex process, including patterns like:
Codex[...] [com.apple.AppKit:Window] Window <ChromeNodeNSWindow: ...> ordered front from a non-active application and may order beneath the active application's windows.
Codex[...] [com.apple.AppKit:Window] order window front conditionally: ...
Codex[...] [com.apple.TextInputUI:CursorUI] ... Create CursorUIViewService: TUINSRemoteViewController
This seems consistent with a focus / first-responder / text-cursor bridge issue in the Codex Desktop UI shell, possibly related to AppKit + Chromium/WebView window handling on macOS.
Workaround
Switching to another macOS app and then back to Codex restores the caret/input focus temporarily. Fully quitting and reopening Codex may also reduce the frequency temporarily.
12 Comments
I am seeing the same symptom on my machine as well. Additional environment details from my local app/system:
26.527.31326(CFBundleVersion3390)com.openai.codex26.5build25F71arm64Mac17,3, Apple M5, 24 GB memoryObserved behavior:
I do not have a deterministic trigger yet, but the workaround is consistently to switch away from Codex and back.
same issue happened。Codex App: 26.527.60818(internal codex-cli: 0.136.0-alpha.2)
MacOS:13.7.8 (22H730),Apple M2 Pro
I am seeing the same symptom on a newer Codex Desktop build, with additional evidence pointing to the pet/avatar overlay focus handoff.
Environment:
26.601.21317(CFBundleVersion3511)codex-cli:0.136.0-alpha.2149.0.7827.5426.5build25F71,arm64Observed behavior:
Sanitized accessibility/runtime evidence:
AXMain=true.AXFocused=false.AXFocusedUIElementwas unavailable/empty for the Codex process.This looks like a "Codex is frontmost, but no Codex UI element is focused" state rather than a disabled composer/editor.
Additional local bundle inspection:
/avatar-overlay.openAvatarOverlay, with the menu titleWake Pet.electron-avatar-overlay-open.Hypothesis:
The pet/avatar overlay can steal focus and then become non-focusable without explicitly restoring focus to the main Codex window/editor. macOS can then leave Codex frontmost but with no focused UI element. Switching away and back forces the system/app to repair focus, which matches the workaround.
Expected behavior:
When the pet/avatar overlay exits keyboard interaction or closes, Codex should explicitly restore focus to the primary window/composer, or otherwise ensure the active main window has a valid focused UI element.
I am seeing the same issue as well. In my case it seemed to start after I enabled the desktop pet/avatar feature. I have since stopped/closed the pet, but I am still seeing the composer/input issue.
Environment:
26.601.21317(CFBundleVersion3511)com.openai.codexcodex-cli:0.136.0-alpha.2149.0.7827.5426.5build25F71,arm64Mac16,7, Apple M4 Pro, 48 GB memoryObserved behavior:
Cmd+A/ Backspace to clear the text, can take around 10 seconds, and sometimes closer to a minute before the command actually applies.Expected behavior:
The composer input should remain responsive when pasting or editing text, and keyboard actions like
Cmd+A/ Backspace should apply immediately without needing to wait.Adding the pet-overlay-specific reproduction from #26577 here, since this looks like the same focus/caret failure with a more deterministic trigger.
In #26577, the issue happens after opening the desktop pet overlay on macOS. Codex remains frontmost, but the composer does not receive input. Closing the pet immediately restores typing.
Local focus capture from the broken state:
CoreGraphics showed two Codex windows:
The
layer=3window appears to be the pet/avatar overlay; thelayer=0window is the main Codex window. Unified logs showed keyboard events still targeting Codex, but no focused UI element was present inside the app.The packaged avatar overlay keyboard-interaction path appears to make the overlay focusable and explicitly focus it:
A local workaround that helped was to keep pointer interaction enabled for the pet/messages, but keep the avatar overlay non-focusable and avoid focusing its webContents. The better product fix may be to restore focus to the primary Codex window/composer when the pet overlay exits keyboard interaction or when Codex is activated via the pet overlay.
There is also a newer report on #26577 from another user with a Japanese IME-specific variant: activating Codex via the Pet overlay leaves the composer without a blinking caret; English input may still insert, but Japanese IME candidates cannot commit into the composer. That points to a first-responder/text-input-client focus handoff issue rather than just a visual caret problem.
Adding a related reproducible case here, since #26577 was closed and this issue appears to track the broader macOS composer caret/input focus problem.
I’m seeing a similar composer focus failure on macOS, but with a more specific trigger: activating Codex via the Codex Pet overlay.
Original comment with details:
https://github.com/openai/codex/issues/26577#issuecomment-4635083623
Environment
Trigger
This happens when Codex is brought to the foreground by clicking the Codex Pet overlay.
I do not see the same issue when bringing Codex to the foreground via:
What happens
After clicking the Pet overlay to bring Codex to the foreground, the composer appears to enter an incomplete focus state:
Workarounds observed
Why this may be relevant to this issue
This looks related to the broader macOS composer caret/input focus issue tracked here, but the Pet overlay provides a more specific and reproducible activation path.
My guess is that Codex is frontmost, and basic key events can still reach the app, but the WebView/composer is not fully restored as the active text input target. This seems to affect Japanese IME composition/commit more severely than direct ABC input.
Adding another live repro case from #27036 that seems to fit this canonical focus/caret issue, with a pet-overlay-specific focus clue.
Environment:
26.602.40724(CFBundleVersion3593)26.5.1build25F80arm64Observed sequence:
Escdid not recover focus.Important pet-specific clue:
When Enter was pressed while the composer was stuck, text inside the Codex pet activity/status bubbles became selected/highlighted instead of the composer submitting. This suggests keyboard focus/selection had landed inside the pet overlay, even though the overlay window did not geometrically cover the composer.
Live diagnostics during the broken state:
focused=missingfor Codex.3.x=0, y=522, width=356, height=320on a1470 x 956display.0.This looks consistent with the hypothesis already discussed here: the pet/avatar overlay can capture or retain keyboard focus/selection, leaving the main composer in a partial focus state with no caret and no Enter handling.
Original duplicate report with the detailed timeline: #27036
Adding a current pet-overlay-specific update from a newer Codex Desktop build.
Environment
26.608.12217(CFBundleVersion3722)26.5.1build25F80arm64Current symptom
The issue is still reproducible in the current app for us: after waking/using the Pet overlay, the main composer can enter a state where Codex is frontmost but the composer cannot accept typing. Tucking/closing the pet overlay or forcing a normal app focus transition recovers typing.
This matches the earlier pet-overlay reports merged here from #26577 and #27036.
Local bundle evidence
The installed app bundle still contains two focus-stealing paths in
app.asarunder.vite/build/main-CIL4OHS5.js.Root avatar overlay keyboard interaction path:
Native composition surface focus handoff path:
Both paths can make a pet/avatar overlay or composition surface become the keyboard-focused Electron window. That is consistent with the observed broken state where the Codex process is frontmost, but the main composer has no usable focused text input client.
Hot patch tested locally
I tested a local
app.asarhot patch that keeps the pet overlay visible and pointer-interactive, but prevents the overlay/surfaces from taking keyboard focus:After patching, the packaged bundle verifies that:
app.focus({ steal: true }) + window.focus() + webContents.focus()avatar overlay path is gone;Suggested product fix
The pet/avatar overlay should not become keyboard-focusable by default. Showing the overlay should use non-activating/inactive presentation, and pointer interactivity should stay separate from keyboard focus.
If there is an overlay text input that genuinely needs keyboard input, that mode should be narrow and should explicitly restore focus to the primary Codex window/composer when the interaction ends. On macOS, avoid the sequence “focus overlay, then later
setFocusable(false)” because it can leave the app frontmost with no valid focused text input target.I did not open an unsolicited PR because the public
openai/codexcheckout does not appear to include the Codex Desktop Electron shell source for this packagedapp.asarpath, anddocs/contributing.mdsays external code PRs are by invitation only. This issue comment includes the concrete patch direction and the two packaged code paths that appear to need the upstream change.Still reproduces on the current installed Codex Desktop build here:
26.611.61049(CFBundleVersion3996)26.5.1build25F80arm64Impact update: this effectively makes the pet feature difficult to use during normal composing. The pet/avatar itself is a favorite feature, but when the overlay/status bubbles steal or disrupt composer focus, the main Codex input can lose the blinking caret and stop accepting normal typing/Enter. Tucking/avoiding the pet is the only reliable workaround so far.
This matches the previous pet-overlay focus evidence in this thread: the overlay does not need to geometrically cover the composer to break input; the failure looks like a keyboard/focus handoff issue between the pet overlay and the main Codex composer.
Still reproducing here on a newer Codex Desktop build.
Environment:
26.611.62324com.openai.codex15.7.3(24G419)Symptoms:
Esc,Cmd+R, switching focus, and quitting/reopening did not reliably recover the composer.This looks consistent with the pet/avatar overlay focus-handoff reports already collected in this thread: Codex is frontmost, but the main composer is not the active focused text input target. The overlay does not need to geometrically cover the composer to break typing/caret/IME behavior.
Practical workaround so far is to avoid using the pet/floating overlay to activate Codex and use Dock /
Cmd+Tab/ the main app window instead, but this is not a durable fix.Adding another reproduction case with a Korean IME-specific symptom.
Environment:
26.611.62324(CFBundleVersion4028)codex-cli:0.140.0-alpha.1926.3.1 (a)build25D771280aarm64구름), 2-set Korean layoutTrigger:
Observed behavior:
구름) 2-set, committed Korean text does not enter the composer.Expected behavior:
Clicking the Pet overlay to activate Codex should restore the main composer as a normal focused text input target, including visible caret/selection state and IME composition/commit support.
This looks consistent with the pet/avatar overlay focus-handoff reports already collected here: Codex becomes frontmost, but the main composer is not fully restored as the active text input client until the Pet is clicked again.
Just checking in: has anyone found a reliable fix or workaround for this? I opened the original issue quite some time ago, and the composer focus/caret problem still appears to persist in recent versions.
At this point, it seems pretty clear that the issue is related to Pets: when Pets is disabled, the problem does not occur; when Pets is enabled, it consistently reproduces.