Skip to content

fix(codex): exclude macOS Electron helpers from client diagnostics (carry #6296) - #6393

Merged
lidge-jun merged 2 commits into
devfrom
codex/rel-l4-macos-helper-clients
Oct 1, 2026
Merged

lidge-jun merged 2 commits into
devfrom
codex/rel-l4-macos-helper-clients

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Carries #6296 by @hulkbig onto current dev. Closes #6291.

On macOS, ocx status and ocx doctor listed Codex.app's Electron helpers (crashpad, renderer, utility) as Codex CLI clients in clients=pending-restart(...). The issue reports one app instance inflating to 15 fake clients, and a long-lived crashpad handler holding the warning open. The cause is the space in Codex Framework.framework. The classifier split the unquoted ps args at the first space, so /Applications/Codex.app/Contents/Frameworks/Codex Framework.framework/.../browser_crashpad_handler produced an argv0 whose basename is Codex.

  • isCodexClientProcess trusts a full executable path over an argv0 guessed from args. A full non-interpreter path that is not codex is rejected, and the snapshot fallback that retried with a truncated argv0 is removed. When only a basename is available, the split Codex.app/Contents/Frameworks/Codex + Framework.framework/ token pair is rejected explicitly.
  • The macOS busy probe reads comm and args separately and joins them by PID, because the combined columns also truncated executable paths with spaces. The Linux probe and the app-server termination selector are unchanged.
  • Tests cover the exact crashpad command from the issue, renderer and utility helpers, routing-adoption enumeration, direct clients, quoted interpreter entrypoints, literal apostrophes, and failed macOS reads. structure/runtime.md and the CLI lifecycle reference describe the rule.

The two contributor commits are replayed unchanged with their author. The contributor branch does not allow maintainer edits, so this is a carry instead of a push to that branch.

Carried from #6296. Original author: @hulkbig.

Co-authored-by: Hulk [email protected]

Verification

  • I did not run local test suites or typecheck. That is an explicit instruction from the project owner, not the AGENTS.md resource exception. Hosted CI at the exact head is the only execution evidence and will be recorded before merge.
  • The contributor reported red/green focused runs on Linux with Bun 1.4.0 (57 passed in native-profile-processes and autostart-health). No native macOS end-to-end run is claimed; the tests are fixture-based.
  • The carry is git cherry-pick of 08248d0723..0a5dc2d5d1 onto dev de8afe2e86, with no conflicts. git diff --check and bun run structure:check pass. No changed file is in the file-size baseline.

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. The probe stays read-only and shell-free and never terminates a process.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Codex client detection on macOS so framework helper processes, including renderer, utility, and crash-reporting helpers, are excluded from pending-restart diagnostics.
    • Restart guidance now distinguishes verified stale app-server processes from fresh or unreadable observations.
  • Documentation

    • Clarified how client diagnostics handle macOS process information and supported interpreter entrypoints.

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

chatgpt-codex-connector Bot commented Oct 1, 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-01T12:57:49.256699Z d1d2dd9 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 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
src/AGENTS.md — auto-discovered
structure/AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 289501ae-c1a6-41ad-97e4-8ebd8df1ee7c

📥 Commits

Reviewing files that changed from the base of the PR and between 7b2deb8 and d1d2dd9.

📒 Files selected for processing (4)
  • docs-site/src/content/docs/reference/cli/lifecycle.md
  • src/codex/native-profile-processes.ts
  • structure/runtime.md
  • tests/codex-integration/native-profile-processes.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

Process classification and macOS process enumeration now exclude Codex.app Electron helpers from Codex client results. The changes also document and test handling of executable paths with spaces.

Changes

Codex client detection

Layer / File(s) Summary
Client process identity rules
src/codex/native-profile-processes.ts, tests/codex-integration/native-profile-processes.test.ts, structure/runtime.md
Classification uses executable paths and immediate entrypoints. Snapshot matching no longer retries with the first command-line token as the executable. Tests cover helper rejection, aliases, interpreter entrypoints, and paths found later in arguments.
macOS process enumeration and diagnostics
src/codex/native-profile-processes.ts, tests/codex-integration/native-profile-processes.test.ts, docs-site/src/content/docs/reference/cli/lifecycle.md
macOS enumeration reads comm and args separately and joins them by PID. Tests cover read failures, paths with spaces, and excluding the current PID. CLI documentation states that the pending-restart client list excludes Codex.app renderer, utility, and crashpad helpers.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: luvs01

Merge Risk: ⚪ Minimal · up to d1d2d

The change excludes macOS helper processes from client diagnostics without changing termination behavior. No concrete merge-blocking issue is established; native macOS validation remains unreported.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: excluding macOS Electron helpers from Codex client diagnostics. The scope matches the documented behavior and linked issue.
Linked Issues check ✅ Passed The PR satisfies the coding requirements in directly linked issue [#6291]. In src/codex/native-profile-processes.ts:84-108, isCodexClientProcess gives a full executable path priority, rejects non-…
Out of Scope Changes check ✅ Passed The changes stay within [#6291]. The source changes modify only read-only client classification, macOS process-field collection, and the related snapshot fallback. The added tests verify the issue beh…
Full details: Docstring Coverage

Explanation

Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration record (MAINTAINERS.md, dev-only)

@lidge-jun
lidge-jun merged commit 0202cc6 into dev Oct 1, 2026
36 of 37 checks passed
@lidge-jun
lidge-jun deleted the codex/rel-l4-macos-helper-clients branch October 1, 2026 16:24
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.

2 participants