openai / openai/codex

[macOS][26.818.41509] ChatGPT/Codex immediately steals foreground focus after switching apps

Open
#40,445 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app bug
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.818.41509 (CFBundleVersion 6962)

What subscription do you have?

ChatGPT account; the exact plan was not provided and does not appear relevant to this macOS window-activation behavior.

What platform is your computer?

macOS 26.4 (build 25E246); Darwin 25.4.0 arm64 arm

What issue are you seeing?

While a normal local task is active, ChatGPT/Codex Desktop immediately becomes the frontmost macOS application again after I switch to another app. This interrupts normal use of other apps and prevents Codex from running unobtrusively in the background.

This is unsolicited foreground activation, not an always-on-top window. The main window has ordinary window layering and the application is using the normal macOS presentation mode.

A keyboard-independent activation trace recorded the following sequence:

1.072 s  Calculator became frontmost
1.079 s  ChatGPT became frontmost

ChatGPT therefore reclaimed foreground focus about 7 ms after Calculator was activated.

What steps can reproduce the bug?
  1. Start a normal local task in ChatGPT/Codex Desktop and leave it running.
  2. Switch to Calculator, Finder, or another macOS app using Command-Tab or by activating the app directly.
  3. Observe that the other app briefly becomes frontmost.
  4. ChatGPT/Codex immediately becomes the frontmost application again without a click, Dock activation, notification interaction, global shortcut, or approval prompt.
  5. Repeat the switch; Codex continues reclaiming foreground focus.
What is the expected behavior?

Codex should preserve the application the user intentionally selected while tasks and background progress continue. The Codex window should become frontmost only after an explicit user action directed at Codex or an interaction that clearly requires foreground attention.

Additional information
  • Stage Manager was disabled during reproduction.
  • No Computer Use task was requested or active for this reproduction.
  • No Codex Micro or Work Louder HID device was connected.
  • All Command, Shift, Option, Control, and Fn key states were false during a controlled test.
  • The ChatGPT window was not fullscreen, modal, in kiosk mode, or always on top. macOS reported normal presentation mode and ordinary window layering.
  • launchctl, user/system LaunchAgents, cron, and background login items were checked for ChatGPT/Codex restart or keepalive automation. No job invoking ChatGPT, Codex, com.openai.codex, or open ... ChatGPT.app was present.

This last check distinguishes the reproduction from #40337 and #33775, which were closed after stale local launchctl restart jobs were found. It also differs from #37115: Stage Manager was off, and this was not a Computer Use PiP refresh-loop reproduction.

No session transcript, project content, account identifiers, local paths, credentials, or complete logs are included.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on macOS 26.4 by running a normal local task, switching to another app, and observing whether Codex reclaims foreground focus. Trace the app's activation behavior and verify that focus remains with the explicitly selected app unless the user interacts with Codex or an interaction requires attention.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.