Skip to content

fix(macos): allow cold ChatGPT Codex probes - #128819

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
hannesrudolph:fix/macos-chatgpt-cold-probe
Aug 27, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
hannesrudolph:fix/macos-chatgpt-cold-probe

Conversation

@hannesrudolph

@hannesrudolph hannesrudolph commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

On macOS, onboarding can miss an authenticated ChatGPT/Codex installation on its first pass. The signed Codex binary inside ChatGPT.app can spend most of the generic 1.5-second command-probe budget in cold-start validation, so the initial probe times out even though an immediate retry succeeds.

Why This Change Was Made

Known ChatGPT/Codex application-bundle binaries now receive a 3-second --version probe budget. Generic PATH discovery, Claude, Gemini, and non-macOS probes keep the existing timeout. The discovered executable continues through the existing codex login status classifier.

User Impact

macOS onboarding detects an already-installed ChatGPT/Codex subscription more reliably on the first pass. Only known application-bundle paths can wait longer; ordinary CLI discovery and other platforms are unchanged.

Evidence

  • Regression test added before the production change: src/commands/onboard-inference.test.ts failed 2 tests and passed 31 against current main; after the fix it passes all 33 tests.
  • node scripts/check-changed.mjs -- src/commands/onboard-inference.ts src/commands/onboard-inference.test.ts completed all runnable guards. Core/test typechecking was unavailable because this RooClaw sparse checkout excludes tracked packages and ui inputs.
  • Focused oxfmt, oxlint, and diff checks passed.
  • Direct Codex contract inspection at openai/codex@4d7e3e90d9781514f9b3b99c95169a2386868ad9: codex-rs/cli/src/main.rs:95-105 confirms Clap owns --version; main.rs:510-514,1394-1407 defines and routes login status; codex-rs/cli/src/login.rs:439-485 confirms the ChatGPT/logged-out/error status outputs and exit behavior consumed here.
  • Exact-head Base-VM cold-start proof used app commit 703aca2086a596f324a04f4de32152b996401f42 and the matching self-contained CLI package, with standalone codex excluded from PATH. The first production detectSetupInference() call completed in 2,313 ms and returned authenticated codex-cli / ChatGPT subscription on the first pass. The powered-on gui/501 session was neither restarted nor logged out. Full proof: fix(macos): allow cold ChatGPT Codex probes #128819 (comment)
  • Production LOC: +7/-1; tests: +39/-4. The production growth is limited to the named app-binary timeout contract.

Maintainer Decision

Accept the app-specific 3,000 ms --version probe budget. It applies only after generic PATH discovery fails and only to the enumerated macOS ChatGPT/Codex app-bundle executables; generic CLI and non-macOS probes remain at 1,500 ms. A matching cold or hung app binary may therefore hold this discovery step for up to 1.5 seconds longer than before. That bounded availability cost is intentional. Exact-head packaged detection completed in 2,313 ms.

Direct inspection of openai/codex@a6e63f9f32525d171676ac49c4e87ab00d76f0ce confirms:

  • codex-rs/arg0/src/lib.rs:157-173 performs dotenv and PATH-alias setup before CLI parsing.
  • codex-rs/cli/src/main.rs:99-106,1050-1056 makes --version a Clap-owned parser exit before subcommand config or authentication work.
  • codex-rs/cli/src/main.rs:1515-1528 routes login status separately to run_login_status.
  • codex-rs/cli/src/login.rs:443-464 loads configuration and authentication only on that login-status path.
  • codex-rs/login/src/auth/storage.rs:265-299,431-440 shows auth storage can load from the keyring with file fallback.
  • codex-rs/keyring-store/src/lib.rs:41-68 shows the default keyring load reaches the OS credential store.

The existing login status auth and keyring semantics are unchanged.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Aug 24, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 10:13 PM ET / August 27, 2026, 02:13 UTC.

ClawSweeper review

What this changes

The PR gives known macOS ChatGPT/Codex application-bundle executables a three-second version-probe timeout during onboarding discovery and adds regression coverage.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open: current main still uses the generic 1.5-second app-bundle probe, while this focused PR addresses that gap. It is maintainer-authored and protected, and direct sibling Codex-source inspection was unavailable, so this review cannot mark it merge-ready.

Priority: P2
Reviewed head: 703aca2086a596f324a04f4de32152b996401f42
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch and regression shape are credible, but direct Codex contract inspection and current-merge-head validation are still needed for merge confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its supplied exact-head macOS result is useful supporting evidence but was not independently rerun here.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its supplied exact-head macOS result is useful supporting evidence but was not independently rerun here.
Evidence reviewed 7 items Current-main gap: Current main enumerates the same six application-bundle paths but invokes each with the default probe options, so it retains the 1.5-second timeout.
Probe owner and bound: The shared local-command probe defaults omitted timeouts to 1,500 ms, propagates an explicit timeout to the process runner, and terminates timed-out process trees.
Scoped implementation and coverage: The branch applies 3,000 ms only after generic Codex discovery fails on macOS, and its focused tests model a cold app binary that succeeds only with that budget while retaining app-path coverage.
Findings None None.
Security None None.

How this fits together

Onboarding probes local AI tools and then classifies an available Codex executable’s login state to offer a reusable provider route. The change adjusts only the macOS app-bundle version probe before the existing login classifier runs.

flowchart LR
  A[macOS onboarding] --> B[Generic command discovery]
  B --> C[Known app-bundle paths]
  C --> D[Version probe timeout]
  D --> E[Codex login classification]
  E --> F[Detected provider route]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept a three-second version-probe budget for only the enumerated macOS ChatGPT/Codex application-bundle binaries? Accept the scoped budget after current-head proof: Verify the Codex contract directly and repeat the focused cold-start check on the merge head before accepting the bounded delay.

Why: This is an intentional availability tradeoff in first-run onboarding, and the reviewer could not independently inspect the required sibling Codex source contract.

Before merge

  • Resolve merge risk (P1) - Each of the six application-bundle paths is probed serially; a present but hung path can consume an additional 1.5 seconds, with multiple such paths accumulating delay below the existing 30-second outer detection bound.
  • Resolve merge risk (P2) - The PR adds six net production lines; no net-neutral refactor was evident because the app-specific timeout is a distinct probe-boundary contract.
  • Resolve merge risk (P1) - Current main has changed the same inference module since the branch base, so targeted validation should run on the actual merge head before landing.
  • Resolve merge risk (P1) - Direct inspection of the required sibling Codex source could not be completed in this read-only, offline environment.
Agent review details

Security

None.

PR surface

Source +6, Tests +35. Total +41 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 1 +6
Tests 1 39 4 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 46 5 +41

Review metrics

Metric Value Why it matters
Production versus test delta production +7/-1 (net +6); tests +39/-4 (net +35) The production growth is limited to the explicit macOS app-bundle timeout contract and is accompanied by focused regression coverage.
App-bundle probe budget 1 timeout changed: 1,500 ms default to 3,000 ms for 6 known paths This is the user-visible availability tradeoff maintainers need to accept before merge.

Merge-risk options

Maintainer options:

  1. Validate the exact merge head (recommended)
    Run the focused inference test and a cold packaged macOS detection proof after resolving current-main drift, then accept the bounded app-specific delay.
  2. Accept the longer probe window
    Maintain the existing scoped 3,000 ms budget if reliable first-pass app detection is worth the extra bounded local-discovery latency.

Technical review

Best possible solution:

Land only after direct Codex command-contract inspection and targeted cold-start validation on the current merge head confirm that the path-scoped three-second budget remains acceptable.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main calls the known macOS app-bundle executable with the 1,500 ms default, while the branch’s focused test models a cold binary that succeeds only at 3,000 ms. Independent execution was unavailable because Corepack attempted to create a cache on the read-only filesystem.

Is this the best way to solve the issue?

Unclear: a path-scoped timeout at the local-probe owner is the narrowest implementation and leaves generic, non-macOS, Claude, and Gemini probes unchanged, but direct Codex-contract inspection and current-merge-head validation remain incomplete.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bdc0c924ce04.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs a bounded macOS onboarding-detection failure without evidence of broader runtime unavailability.
  • merge-risk: 🚨 availability: The change intentionally permits each enumerated local app-bundle probe to wait up to 1.5 seconds longer.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its supplied exact-head macOS result is useful supporting evidence but was not independently rerun here.

Evidence

What I checked:

  • Current-main gap: Current main enumerates the same six application-bundle paths but invokes each with the default probe options, so it retains the 1.5-second timeout. (src/commands/onboard-inference.ts:202, bdc0c924ce04)
  • Probe owner and bound: The shared local-command probe defaults omitted timeouts to 1,500 ms, propagates an explicit timeout to the process runner, and terminates timed-out process trees. (src/system-agent/probes.ts:27, 703aca2086a5)
  • Scoped implementation and coverage: The branch applies 3,000 ms only after generic Codex discovery fails on macOS, and its focused tests model a cold app binary that succeeds only with that budget while retaining app-path coverage. (src/commands/onboard-inference.ts:196, 703aca2086a5)
  • Gateway availability boundary: Setup detection runs in a worker rather than the Gateway event loop and has a 30-second outer timeout, limiting the effect of slower local probes on Gateway health. (src/system-agent/setup-inference-detection.ts:125, 703aca2086a5)
  • Feature-history provenance: Current-main blame attributes the app-path probe flow to Josh Avant’s current source revision; Peter Steinberger’s earlier CLI-login detection fix is available as commit a2c857e. (src/commands/onboard-inference.ts:202, a2c857ea0e34)
  • Replacement is not yet a safe supersession: The related replacement PR is open and draft, with unknown mergeability and pending packaged-app acceptance in the supplied discussion, so it cannot supersede this viable focused PR. (8b90f2797708)

Likely related people:

  • Josh Avant: Current-main blame identifies this author on the app-bundle probe flow that the PR changes. (role: recent area contributor; confidence: medium; commits: 29625bc310; files: src/commands/onboard-inference.ts)
  • Peter Steinberger: Authored the prior CLI-login detection repair that established the surrounding inference-detection behavior. (role: feature-history contributor; confidence: medium; commits: a2c857ea0e34; files: src/commands/onboard-inference.ts)
  • Patrick-Erichsen: The supplied timeline records this person as the current assignee for the PR. (role: assigned reviewer; confidence: high; files: src/commands/onboard-inference.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inspect the exact sibling Codex source contract for the invoked commands.
  • Run the focused cold-app detection proof against the current merge head and redact any private machine details.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-08-24T18:01:11.262Z sha 703aca2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T18:43:50.877Z sha 703aca2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T19:12:56.907Z sha 703aca2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T19:52:37.616Z sha 703aca2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T20:38:34.719Z sha 703aca2 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T17:54:49.981Z sha 703aca2 :: needs maintainer review before merge. :: none

@hannesrudolph

hannesrudolph commented Aug 24, 2026 •

Copy link
Copy Markdown
Member Author

Completed the required direct sibling Codex source inspection locally at openai/codex@4d7e3e90d9781514f9b3b99c95169a2386868ad9:

  • codex-rs/cli/src/main.rs:95-105 declares Clap's version contract for codex --version.
  • codex-rs/cli/src/main.rs:510-514 defines login status; main.rs:1394-1407 routes it to run_login_status.
  • codex-rs/cli/src/login.rs:439-485 confirms ChatGPT success exits 0, logged-out/error states exit 1, and the exact status text consumed by OpenClaw.

Conclusion: this PR changes only the macOS app-bundle discovery timeout. It does not change Codex arguments, parsing, auth semantics, or generic PATH probes. Focused exact-head coverage remains 33/33 passing.

Exact-head Base VM cold-start proof

Completed on the live immutable Base Parallels snapshot with its existing gui/501 login session intact; the VM was not restarted or logged out.

  • App bundle OpenClawGitCommit: 703aca2086a596f324a04f4de32152b996401f42.
  • Exact self-contained CLI package: OpenClaw 2026.8.1 (703aca2).
  • Probe environment intentionally excluded any standalone codex from PATH; /Applications/ChatGPT.app/Contents/Resources/codex was the available desktop binary.
  • The first production detectSetupInference() call after restoring Base completed in 2,313 ms.
  • First-pass result: codex-cli, logged in · ChatGPT subscription, credentials: true, model openai/gpt-5.6-sol.

This closes the remaining macOS cold-start evidence gap: exact-head discovery found the authenticated ChatGPT-bundled Codex route on the first attempt and completed within the app-bundle probe's three-second bound.

@hannesrudolph

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 24, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 24, 2026
@hannesrudolph
hannesrudolph marked this pull request as ready for review August 25, 2026 17:49
@Patrick-Erichsen Patrick-Erichsen self-assigned this Aug 25, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete for exact head 703aca2086a596f324a04f4de32152b996401f42.

  • Accepted decision: the 3,000 ms --version budget applies only after generic PATH discovery fails and only to the enumerated macOS ChatGPT/Codex application bundles. Generic and non-macOS probes remain at 1,500 ms. The bounded extra 1.5-second availability cost is intentional.
  • Exact-head packaged detection completed in 2,313 ms and selected the authenticated ChatGPT-bundled Codex route on the first pass.
  • Direct openai/codex@a6e63f9f32525d171676ac49c4e87ab00d76f0ce inspection confirmed --version exits during Clap parsing after arg0 PATH setup (codex-rs/arg0/src/lib.rs:157-173, codex-rs/cli/src/main.rs:99-106,1050-1056). login status remains a separate config/auth path (codex-rs/cli/src/main.rs:1515-1528, codex-rs/cli/src/login.rs:443-464), including the existing auth-storage and OS-keyring behavior (codex-rs/login/src/auth/storage.rs:265-299,431-440, codex-rs/keyring-store/src/lib.rs:41-68).
  • Exact-head CI run 32880185161 attempt 2 is green after the one allowed failed-job rerun. Exact-head Workflow Sanity run 32759608087 attempt 2 is green.
  • Native review and landing gates passed: scripts/pr review-init 128819, native checkouts, fresh branch autoreview (clean, 0.99), artifact validation, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 128819.
  • Current-main merge preview is clean with no semantic drift. Production delta is +7/-1 (net +6); tests are +39/-4 (net +35).
  • Latest ClawSweeper rank-up moves are applied. No source or test edits were made by the maintainer.

Known follow-up: topology cleanup for #130541/#130542 remains pending outside this landing task.

@vincentkoc
vincentkoc merged commit 1fd1d3c into openclaw:main Aug 27, 2026
564 of 566 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

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

Labels

commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants