Skip to content

fix: support Codex Desktop hosted by ChatGPT#267

Merged
wxtsky merged 1 commit into
wxtsky:mainfrom
Haoo-7:fix/codex-chatgpt-desktop-status
Jul 23, 2026
Merged

fix: support Codex Desktop hosted by ChatGPT#267
wxtsky merged 1 commit into
wxtsky:mainfrom
Haoo-7:fix/codex-chatgpt-desktop-status

Conversation

@Haoo-7

@Haoo-7 Haoo-7 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Recognize Codex Desktop when its executable is hosted by ChatGPT.app.
  • Discover project cwd and session metadata from Codex rollout transcripts when the shared app-server cwd is /.
  • Ignore empty/root-cwd placeholder hooks that would overwrite a real discovered session.
  • Parse Codex JSONL task_started, task_complete, turn_aborted, and turn_failed events into CodeIsland running/idle state.
  • Treat Codex event messages as activity heartbeats so long turns are not reset to idle by the timeout watchdog.

Background

Codex has recently been integrated into ChatGPT as a multi-purpose host application. On macOS, the Codex executable can now run from:

/Applications/ChatGPT.app/Contents/Resources/codex

The shared app-server commonly reports / as its cwd, while the actual project cwd is stored in the rollout transcript metadata. Some desktop invocations also emit empty or root-cwd hook payloads.

The previous CodeIsland integration assumed the older standalone Codex.app layout and relied on hook/message parsing for live status, so sessions could be discovered but remained idle.

Test Plan

  • swift build -c release --arch arm64 passes.
  • Added JSONL parser coverage for Codex turn lifecycle events, latest turn recovery, and activity heartbeats.
  • Added discovery coverage for ChatGPT.app executable paths, large session metadata, transcript cwd recovery, and placeholder hooks.
  • swift test could not run on the development machine because the active Command Line Tools installation has no XCTest module; the test targets report this environment error. CI with a full Xcode toolchain should run the test suite.

@wxtsky
wxtsky merged commit ed6f1bb into wxtsky:main Jul 23, 2026
wxtsky added a commit that referenced this pull request Jul 23, 2026
- traecli-next settings row now shows the Trae icon (#266 review)
- fix missing backslash in codex meta test filename interpolation (#267 review)
- note that turn_failed is a forward-compatible guess, absent from today's
  codex EventMsg enum (#267 review)
- probe ~/.config/claude (ccusage-style default) ahead of
  ~/.config/claude-code in the XDG rung, with test (#270 review)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wxtsky

wxtsky commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Merged (ed6f1bb) — thanks! The upstream claims verified cleanly: ChatGPT.app keeping bundle id com.openai.codex, and the task_started/task_complete/turn_aborted rollout events all match codex-rs sources. Three small things I touched up on main afterwards (1d92797): a missing \ in a test filename interpolation, and a comment noting turn_failed isn't in today's codex EventMsg enum (kept as forward-compat). One perf note for later: latestCodexTurnStatus reads the whole rollout file forward on first attach — codex rollouts can reach hundreds of MB, so a tail-first scan like #280 proposes would be a good follow-up.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants