Skip to content

fix(service,codex): recognize Desktop supervision on Windows and discover the Codex app CLI on macOS - #7011

Merged
lidge-jun merged 5 commits into
devfrom
codex/rt284-issues-platform
Oct 12, 2026
Merged

lidge-jun merged 5 commits into
devfrom
codex/rt284-issues-platform

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

Two platform changes stacked on the proxy fixes.

  • 52ca9103f7: on Windows, ocx status, doctor and resolve now recognize OpenCodex Desktop as the proxy's supervisor, and service install/repair/start/restart refuse to compete with it. Desktop is confirmed only when the PID files agree, the parent is opencodex-desktop.exe with the proxy as ocx.exe in the same install folder, both share a session, the parent started first, and two readings agree; anything uncertain is unknown, never "no Desktop".
  • ca946248f6: on macOS, the CLI bundled in the Codex app (ChatGPT.app, bundle id com.openai.codex, current Contents/Resources/codex-cli/bin/codex and the older Contents/Resources/codex) is an installed candidate after every existing one. A persisted CLI selection is never silently moved to the app binary.
  • 91864ee9e7: union fix. With the app installed, a read-only Remote Link settings request (fix(link): read-only Home management, Home Codex settings and one CLI refusal on Remote Link Children #6959) reads the app's Info.plist; the relay test now judges opens by write capability.

Closes #6853
Closes #6973

Verification

  • Lane: Windows supervision 14 pass; desktop startup/status/runtime/link focused 397 pass on Bun 1.4.3; real ChatGPT.app 26.1007 bundle id and prompt probe confirmed on macOS. Independent gpt-6.1-sol reviews PASS for each commit and the restacked head.
  • Union gates at the final stack head 3441130ea8 (Bun 1.4.3 test runner, external checkout): bun run typecheck, structure:check, privacy:scan, skill:surface:check exit 0; guards (test-layout, layout tooling with the pinned runner, file-size ratchet, repo hygiene, skill-ocx, structure-ssot) 110 pass / 0 fail; GUI locale parity 27 pass; lint:gui and build:gui exit 0; scripts/test-layout/layout.json 1999 lines.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 12, 2026 17:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T17:30:30.462950Z 3441130 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6b701231-2ad8-427d-ab86-286a2029f761

📥 Commits

Reviewing files that changed from the base of the PR and between b71d1e1 and d91ecf8.


📒 Files selected for processing (31)
  • devlog/_plan/261013_rt284_l4_platform/000_plan.md
  • devlog/_plan/261013_rt284_l4_platform/010_6853_windows_supervision.md
  • devlog/_plan/261013_rt284_l4_platform/020_6973_chatgpt_app_cli.md
  • devlog/_plan/261013_rt284_l4_platform/030_wp3_restack_and_final.md
  • docs-site/src/content/docs/guides/codex-integration.md
  • docs-site/src/content/docs/guides/desktop-app.md
  • docs-site/src/content/docs/ko/guides/codex-integration.md
  • docs-site/src/content/docs/ko/guides/desktop-app.md
  • docs-site/src/content/docs/zh-cn/guides/codex-integration.md
  • docs-site/src/content/docs/zh-tw/guides/codex-integration.md
  • scripts/test-layout/layout.json
  • src/cli/status.ts
  • src/codex/catalog/bundled.ts
  • src/codex/prompt-text-probe.ts
  • src/codex/runtime.ts
  • src/service/desktop-startup.ts
  • src/service/desktop-supervision.d.mts
  • src/service/desktop-supervision.mjs
  • structure/catalog.md
  • structure/codex-home.md
  • structure/codex-prompts.md
  • structure/desktop-shell.md
  • structure/ops/service-and-sidecars.md
  • structure/runtime.md
  • tests/cli/cli-status-startup-health.test.ts
  • tests/codex-integration/codex-prompt-text-probe.test.ts
  • tests/codex-integration/codex-runtime-macos-desktop.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/server/link-management-relay.test.ts
  • tests/service/service-desktop-startup.test.ts
  • tests/service/service-desktop-supervision-windows.test.ts

 ________________________________________________________
< Code review is a dish best served cold. Like a carrot. >
 --------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added intake: hygiene-blocked Deterministic PR hygiene checks failed bug Something isn't working labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • new_suppression — A new TypeScript, lint, formatter, or similar suppression was added. Fix the underlying issue or obtain suppression-approved. Paths: src/codex/runtime.ts.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft October 12, 2026 17:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3441130ea8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

in the final report.


## Outcome (wp3 restack)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move the completed lane record to _fin

This section records the terminal outcome, and 000_plan.md already identifies a final head and passing reviews, so this unit is no longer open. Leaving the directory under devlog/_plan/ misrepresents completed work as active; move the entire 261013_rt284_l4_platform unit to devlog/_fin/ in this commit.

AGENTS.md reference: AGENTS.md:L108-L111

Useful? React with 👍 / 👎.

@github-actions
github-actions Bot marked this pull request as ready for review October 12, 2026 17:38
@github-actions github-actions Bot removed the intake: hygiene-blocked Deterministic PR hygiene checks failed label Oct 12, 2026
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-proxy branch from d9ce24c to 80f886c Compare October 12, 2026 18:43
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-platform branch from 5787743 to 310af60 Compare October 12, 2026 18:44
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-proxy branch from 80f886c to dce81dc Compare October 12, 2026 20:17
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-platform branch from 310af60 to d3a5818 Compare October 12, 2026 20:19
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-proxy branch from dce81dc to ed2e435 Compare October 12, 2026 20:37
inspectDesktopSupervision returned "unsupported" on Windows, so status, doctor,
service install/repair/start/restart, stop and update all behaved as if no
Desktop ran beside a package-installed ocx.

Windows now proves supervision with the issue's standard: ocx.pid and
runtime-port.json both name the runtime; its parent is a live
opencodex-desktop.exe; both images are drive-qualified and the runtime is the
Desktop's sibling ocx.exe; parent and child share a session; the parent was
created first; and two snapshots agree. Each snapshot is one bounded
PowerShell Win32_Process read (Node-safe, no FFI) inside a 6 s budget per
inspection. Anything inconclusive stays unknown, and a Desktop image observed
before a later field fails validation keeps its veto.

The startup diagnostic gains a Windows path: it names the live supervisor (and,
for a durable claim, checks the roaming install-id) but never credits Start at
Login, so Windows does not read as Desktop-protected and drops ocx service
advice. For an older Windows runtime without a Desktop diagnostic, status and
doctor accept an owned local reading bound to the same PID pair; macOS and
Linux keep requiring an unowned one.

Closes #6853
A Mac whose only Codex is the Codex desktop app (ChatGPT.app, bundle id
com.openai.codex) left OpenCodex with no runtime: the macOS installed
candidates never looked inside the app, and the Desktop sidecar's GUI PATH
never contains it (#6963).

macOS now adds the app's CLI as the lowest-precedence candidate: after the
environment override, the persisted selection, the shim, PATH, established
install locations and the bare fallback; system /Applications before
~/Applications; the current entrypoint Contents/Resources/codex-cli/bin/codex
(measured on 26.1007) before the older Contents/Resources/codex. A candidate
counts only when the bundle's top-level XML Info.plist reports
CFBundleIdentifier com.openai.codex, read in-process with a 64 KiB bound and no
subprocess. The identity is re-checked for any path inside either bundle,
including an explicit override or a persisted app path after the app is
replaced.

App candidates never take over a runnable automatically persisted selection:
they are excluded from the deferred fast-path handover and from
supersededDiscovered, and only appear in newerAvailable. Deferred resolution
skips the unproven bare fallback only when a verified app candidate exists.

The bundled-catalog and prompt consumers already map unsupported commands and
spawn failures to unavailable; structurally malformed JSON (null model rows,
null message or content items) no longer throws.

Closes #6973
The #6959 passive-read effect watcher counted every numeric open flag other
than exactly O_RDONLY as a write. With #6973 a passive GET /api/settings on a
Mac that has the Codex app installed resolves the runtime and reads the app's
Info.plist with O_RDONLY | O_NONBLOCK (the non-blocking flag keeps a FIFO at
that path from hanging discovery), which the watcher reported as a write.

Numeric flags are now judged by their write bits (O_WRONLY, O_RDWR, O_CREAT,
O_TRUNC, O_APPEND) and string flags by Node's write-capable modes, with a
deterministic assertion so the check does not depend on the host having the
app installed. Subprocess and write watchers are unchanged.
…and #6973

Roadmap, per-issue diff-level designs with architect and audit dispositions,
and the wp3 restack onto the L3 head with the #6959 passive-read watcher
finding.
… control-character regex

ca94624 (#6973) rejected control characters in each plist node with a
control-character regex literal and an eslint-disable-next-line
no-control-regex directive, which the PR hygiene gate refuses as a new
suppression. The node check now uses the reader's existing XML 1.0 Char
predicate (allXmlChars), a code-point comparison: it rejects everything the
regex did (C0 controls other than tab/LF/CR, U+FFFE, U+FFFF) and is the same
rule already applied to the whole decoded document, so accepted and rejected
plists are unchanged. No suppression remains.
@lidge-jun
lidge-jun force-pushed the codex/rt284-issues-platform branch from d3a5818 to d91ecf8 Compare October 12, 2026 20:39
Base automatically changed from codex/rt284-issues-proxy to dev October 12, 2026 21:44
@lidge-jun
lidge-jun merged commit bf57900 into dev Oct 12, 2026
49 of 50 checks passed
@lidge-jun
lidge-jun deleted the codex/rt284-issues-platform branch October 12, 2026 21:45
agentHits added a commit to agentHits/opencodex that referenced this pull request Oct 12, 2026
Ten more commits landed on dev (lidge-jun#7010, lidge-jun#7011). The merge is automatic and
none of them touch gui/, src/oauth/, src/providers/ or
src/server/management/, the areas this branch changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lidge-jun lidge-jun mentioned this pull request Oct 13, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant