codex - 💡(How to fix) Fix Codex Desktop pet overlay can leave the main composer without focus on macOS

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Local workaround tested

I patched the packaged app locally to stop the avatar overlay from taking keyboard focus.

I tested a local patch that keeps pointer interaction working but prevents the overlay from becoming keyboard-focusable:

Code Example

~/.codex/pets/doudou

---

App: Codex Desktop
OS: macOS
Bundle: /Applications/Codex.app
Observed Chromium/Electron framework path: 149.0.7827.54
Custom pet: ~/.codex/pets/doudou

---

frontmost=Codex pid=59414
no focused window
no focused element
codex_window_count=2
codex_window name=Codex focused=false
codex_window name=Codex focused=false

---

cg_window id=4314 pid=59414 owner=Codex layer=3 x=0 y=39 w=356 h=320
cg_window id=4182 pid=59414 owner=Codex layer=0 x=221 y=39 w=1579 h=1130

---

destinations for Keyboard event: (<keyboardFocus; Codex.59414; token: viewbridge-key-window>)
delivery manager destinations for kCGSEventKeyDown event: <keyboardFocus; pid: 59414; token: viewbridge-key-window>

---

/Applications/Codex.app/Contents/Resources/app.asar
.vite/build/main-*.js

---

n.setFocusable(true);
n.show();
app.focus({ steal: true });
n.focus();
n.webContents.focus();

---

this.applyPointerInteractivityPolicy();
n.setFocusable(false);
return;
RAW_BUFFERClick to expand / collapse

On macOS, after opening the desktop pet overlay, Codex sometimes stops accepting input in the main composer.

The app is still frontmost. Clicking the composer does not always restore typing. Closing the pet immediately fixes it.

I originally noticed this with a custom pet at:

~/.codex/pets/doudou

The pet assets look valid: the spritesheet is 1536x1872, matching the expected 8 x 9 atlas with 192x208 cells. This does not look like an asset-format issue.

Environment

App: Codex Desktop
OS: macOS
Bundle: /Applications/Codex.app
Observed Chromium/Electron framework path: 149.0.7827.54
Custom pet: ~/.codex/pets/doudou

Steps

  1. Open Codex Desktop.
  2. Open the pet overlay.
  3. Switch away from Codex.
  4. Switch back to Codex.
  5. Click the composer and type.

Expected

The composer should accept input.

The pet overlay should still be visible and clickable.

Actual

Codex is frontmost, but the composer does not receive input.

Closing the pet overlay restores typing immediately.

Evidence

I captured the state with a local focus logger. During the broken state:

frontmost=Codex pid=59414
no focused window
no focused element
codex_window_count=2
codex_window name=Codex focused=false
codex_window name=Codex focused=false

CoreGraphics showed two Codex windows:

cg_window id=4314 pid=59414 owner=Codex layer=3 x=0 y=39 w=356 h=320
cg_window id=4182 pid=59414 owner=Codex layer=0 x=221 y=39 w=1579 h=1130

The layer=3 window appears to be the pet/avatar overlay. The layer=0 window is the main Codex window.

Unified log showed keyboard events still going to Codex:

destinations for Keyboard event: (<keyboardFocus; Codex.59414; token: viewbridge-key-window>)
delivery manager destinations for kCGSEventKeyDown event: <keyboardFocus; pid: 59414; token: viewbridge-key-window>

So the OS is sending keyboard events to Codex, but no focused element exists inside the app.

Local workaround tested

I patched the packaged app locally to stop the avatar overlay from taking keyboard focus.

The relevant packaged code is in:

/Applications/Codex.app/Contents/Resources/app.asar
.vite/build/main-*.js

The problematic path appears to be the avatar overlay keyboard interaction handler. In the packaged JS it does roughly this:

n.setFocusable(true);
n.show();
app.focus({ steal: true });
n.focus();
n.webContents.focus();

I tested a local patch that keeps pointer interaction working but prevents the overlay from becoming keyboard-focusable:

this.applyPointerInteractivityPolicy();
n.setFocusable(false);
return;

With that narrower patch, the pet remains visible and activity bubble clicks still work, while the main composer no longer gets stuck as easily.

Possible fix

The avatar overlay should probably not call setFocusable(true), app.focus({ steal: true }), window.focus(), or webContents.focus() unless an actual text input inside the overlay needs keyboard input.

Pointer interaction for pet messages/replies can remain enabled. Keyboard focus should stay with, or return to, the main Codex window/composer.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING