Repository navigation
fix(codex): keep Computer Use working after desktop updates - #127778
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 1:38 AM ET / 05:38 UTC. ClawSweeper reviewWhat this changesAdds event-driven macOS desktop-generation tracking so managed Codex Computer Use artifacts and app-server clients refresh after a desktop update without restarting the Gateway. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open for maintainer review. The prior non-manifest plugin-byte gap is covered by the exact head, but automatic convergence changes the managed-home update default and direct Codex contract inspection is unavailable because the required sibling checkout is absent. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Codex plugin starts app-server processes for agent turns while managed macOS desktop artifacts provide Computer Use. The new lifecycle owner detects artifact changes, retires old same-home clients, and reconciles artifacts before new turns start. flowchart LR
A[Desktop app update] --> B[Generation watcher]
B --> C[Stable artifact fingerprint]
C --> D[Retire old same-home clients]
D --> E[Reconcile managed artifacts]
E --> F[New Computer Use turn]
Decision needed
Why: This changes the default lifecycle and upgrade experience for existing operators; tests and source cannot establish product acceptance. Before merge
Agent review detailsSecurityNone. PR surfaceSource +1662, Tests +2435, Docs +19. Total +4116 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the managed-isolated-home boundary and accept automatic convergence only after an owner confirms that changed upgrade behavior and directly verifies the pinned Codex contract. Do we have a high-confidence way to reproduce the issue? No high-confidence local reproduction is available in this read-only Linux checkout; source and supplied exact-head macOS evidence describe the desktop-update path. Is this the best way to solve the issue? Unclear: the generation owner directly addresses same-path replacement and the prior plugin-byte gap, but maintainers must decide whether automatic convergence is the intended default. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f75404ec16ae. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (34 earlier review cycles; latest 8 shown)
|
0a5205e to
2792681
Compare
|
@clawsweeper re-review Final autoreview found that explicitly package-first clients with enabled Computer Use could still consume desktop-owned artifacts without carrying the desktop generation. Current head now binds that path to the same generation owner. The focused regression is red before the fix and green after it; affected Codex suites pass 336/336 and |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review A second final autoreview found that generation-tagged standard desktop commands selected through |
|
🦞🧹 I asked ClawSweeper to review this item again. |
f1d431c to
abb636f
Compare
|
@clawsweeper re-review Final behavioral delta since the last completed review: generation Y now waits for same-home generation-X leases before publishing fixed-path Computer Use artifacts, and explicit package app-server clients with Computer Use enabled are attached to the desktop generation. Focused red/green regressions cover both paths. Prior rank-up moves are addressed: the PR body records the acting agent’s direct |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8f58bf4 to
5b87a1e
Compare
Final-head macOS desktop-generation proofValidated exact PR head Dependency and generation shape
Observed result
Exact-head validation
Evidence digests:
|
|
@clawsweeper re-review Please assess exact head Both prior rank-up moves are complete:
Exact-head CI is green (127 success / 43 intentional skips), the 12 focused suites pass 361/361, guest full build passes, and P1 autoreview is clean. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact-head finding closure for 89906f6:
Exact-head unattended macOS proof was also rerun after this repair:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Related: #127024
What Problem This Solves
Codex-native Computer Use could retain an app-server loaded from the previous ChatGPT or Codex desktop build after the desktop updated in place. The first request after the update could then fail with a closed transport until the Gateway restarted.
Architecture and Product Decision
The Codex plugin now owns one event-driven desktop generation for the standard macOS ChatGPT and Codex candidates. A settled generation change gracefully detaches only older physical app-server clients. Active X turns finish on X; new acquisitions for the same isolated home wait for X to physically exit, reconcile the fixed-path artifacts, and start on Y. Unrelated homes remain independent.
The owner also materializes Codex's reserved
openai-bundledmarketplace as a contained real wrapper inside an eligible isolatedCODEX_HOME, then lets Codex app-server ownmarketplace/add. Codex canonicalizes local sources and accepts the reserved name only at$CODEX_HOME/.tmp/bundled-marketplaces/openai-bundled, so a direct symlink to/Applications/...cannot satisfy the dependency contract.This lifecycle-owned automatic convergence is the accepted default for standard managed ChatGPT/Codex desktop candidates on the existing macOS native-Computer-Use surface. It does not widen platform support, custom executable support, or mutation authority. There is no request-hot-path freshness polling, new config, or new dependency.
autoInstall: false, user homes, and explicitCODEX_HOMEremain opt-outs.autoRepairremains limited to failed-readiness stale-MCP repair.If the bundle changes again during startup, the stale client is fenced before login or
thread/start; the existing bounded startup retry owns recovery. This is not a blanket retry promise for unrelated transport failures, unsupported update mechanisms, or custom executable paths. Gateway restart remains the visible recovery for those cases.Root Cause and Canonical Fix
Current
mainmemoizes native service selection by path strings and warm app-server identity does not encode same-path desktop replacement. Failure-driven retry cannot reliably distinguish a desktop-generation transition from the unrelated random Computer Use transport closures observed during the spike.The canonical owner is therefore the desktop generation plus its per-
CODEX_HOMEartifact reconciliation. Filesystem events only invalidate that owner; settled fingerprints identify a change, while authenticity and mutation authority still come from known candidate resolution, signed service inspection, and captured managed-home identities. The old completed-service path cache is removed. No parallel polling or compatibility path remains. The settled fingerprint includes a deterministic, bounded hash of the complete Computer Use plugin tree—not onlyplugin.json—and recursive app-root watching observes in-place skill, MCP-config, launcher, and asset changes. A same-version non-manifest byte change therefore advances the generation and forces the managed cache to replace those bytes.Exact-head Live Proof
PR head
89906f686f2211af94349939d30d6ae6182f9903, based on935c555c98d6b38af76faa6a0b1370353d1828df, was built and exercised in the existing macOS UTM testbox with two notarized official ChatGPT desktop generations and two simultaneous isolated agents.0.149.1; desktop X/Y embedded0.149.0-alpha.4.1and.4.3, so both desktop binaries were rejected for app-server ownership and the actual OpenClaw app-server processes ran fromnode_modules/@openai/codex-darwin-arm64. Desktop artifacts still supplied Computer Use, exercising the package-fallback path this PR must support.14037remained unchanged while/Applications/ChatGPT.appwas physically replaced X → Y.26.818.41509build6962; Computer Use1.0.1000816; Codex SHA-25609db9560f6f9dec139d3324254fb3c8fdbad5ecce1d8c794113dc15294f6aefd; app CDHash59729f374e9041c73fae77d3fb33ce323d514ba4.26.818.61809build7019; Computer Use1.0.1000854; Codex SHA-256dd304ffe232fa9e782ed3e5358776d270e394c2fb85cab846f989823f0843313; app CDHash379714a99e8aa5451a17f85033b2a5b0e1bad74a.com.openai.codexand Team ID2DC432GLL2.multi-aandmulti-bturns each recorded exactly one successfulcomputer-use.list_appsMCP completion and returnedSUCCEEDED(OpenClaw run IDs2088908a-fda8-498d-9869-27d272b71c6aanddee8beda-205a-44fc-b06f-dd69e4df88f1). Both isolated homes held service/cache build1000816.14313/14315. After Y settled, replacements14922/14926owned the two homes.computer-use.list_appsMCP completion and returnedSUCCEEDED(run IDsae138469-27fd-4897-9103-2fc31deb9b54and71cae688-7ba9-48ed-aa0c-5493c7665f27). No turn replay or Gateway restart occurred.1000816 → 1000854, added cache1.0.1000854, and resolved the managed wrapper to plugin1.0.1000854.19321was released, Y remained installed, the X backup was restored, and the unrelated preserved Gateway remained healthy on PID750.The redacted evidence summary and exact MCP completion records are posted as a PR comment; 51 local evidence files are SHA-256 inventoried. The exact-head redacted evidence summary is available at https://gist.github.com/joshavant/6e55755f03913bffb13dc4e1575de5eb (evidence SHA-256
9409b66319b234c0470f6541e961b5cbfa0ea86c0a368d0dad6579605a4fe187; native-call proof SHA-256dbcba8f6e23880e864f33e8a4e74d45d5aa05d1e31f66eb62c4f8570aeeeee49; inventory SHA-256dc461d5c50e1a0be04d65959470e1a4870fc968e92264de89941574b3439b20b); a prior-head artifact remains at https://gist.github.com/joshavant/98fe9317f42147a30621ad5f85923e57.Automated Validation
node scripts/check-changed.mjs: passed formatting, production/test types, lint, package/lock guards, plugin boundaries, database guards, docs checks, dead-export checks, and import-cycle checks.pnpm install --frozen-lockfileand fullpnpm build: passed, including the Control UI size gate.gpt-5.6-sol, high reasoning): clean, no accepted/actionable findings. The post-review plugin-byte repair was rated correct with confidence0.90.Current-main Comparison
The branch is based directly on
origin/mainat935c555c98d6b38af76faa6a0b1370353d1828df. Liveorigin/mainis nowe9017714c2d64cb564b467648d8a5c36dd191bff; all commits after the branch base leaveextensions/codexunchanged. This includes #128370 (b68c136609049e65852cb400052fec65539f066a), which upgrades managed Codex to0.149.1, rejects older/prerelease desktop app-servers, and replaces stale-child killing with Codex-ownedconfig/mcpServer/reload.That merge does not replace this PR's generation owner. Upstream reload refreshes config and MCP runtimes inside the existing app-server; it does not identify same-path desktop replacement, retire the physical app-server, or converge the per-agent Computer Use service/cache/wrapper. The integration preserves #128370's reload for ordinary readiness failures. Only typed
CODEX_APP_SERVER_START_SELECTION_CHANGEDbypasses that stale-client retry and reaches the existing bounded physical-startup retry after probe-thread cleanup.The exact-head VM proof above exercises this combined behavior: stable managed app-server
0.149.1, desktop-owned Computer Use1000816 → 1000854, two isolated homes, and simultaneous first requests without a Gateway restart.Dependency Contract Checked
Personally inspected the sibling OpenAI Codex checkout at exact release tag
rust-v0.149.1(ff29a44391deccde0aba0f8390337d7f3c319ea4) after fetching current upstream refs (origin/main3a469a297daeab77a60c142669262366f344a830):codex-rs/core-plugins/src/marketplace_add/source.rs:149-167: local sources are canonicalized.codex-rs/core-plugins/src/marketplace_policy.rs:306-336,493-537: reserved bundled names are accepted only from the managedCODEX_HOMEroot.codex-rs/core-plugins/src/marketplace.rs:312-333,650-692: the real wrapper manifest and controlled local plugin links satisfy marketplace loading while plugin paths remain rooted.codex-rs/core-plugins/src/marketplace_add.rs:91-153:marketplace/addvalidates and records the local source.codex-rs/utils/home-dir/src/lib.rs:9-50: explicitCODEX_HOMEmust exist and is canonicalized.codex-rs/app-server/src/request_processors/initialize_processor.rs:96-147andapp-server-protocol/src/protocol/v1.rs:68-79: initialize reports the configured absolute home, not a desktop-generation token.codex-rs/app-server-protocol/src/protocol/common.rs:1129-1133,app-server/src/request_processors/mcp_processor.rs:79-86, andapp-server/src/mcp_refresh.rs:9-28:config/mcpServer/reloadreloads config and refreshes existing threads; it does not replace the physical app-server or supply a desktop generation.codex-rs/core/src/session/turn.rs:659-670,1450-1477: MCP/plugin state is refreshed and plugins are loaded during turn work, so Y publication waits for the X physical process to exit, not merely for logical client closure.This direct exact-release inspection satisfies the repository's Codex hard gate. A hosted reviewer that cannot access a sibling checkout can reproduce the check from the immutable tag and paths above; its environment limitation is not a missing contributor action.
Safety and Compatibility
autoInstall, and an OpenClaw-owned isolated home. User homes, explicitCODEX_HOME, and custom commands are not seized by the generation owner.SECURITY.md. Same-path trusted-host replacement and pre-existing trusted-local symlink priming remain outside the public boundary; containment is nevertheless enforced as production hardening.Size and Best-fix Judgment
Production:
+1728/-183(net+1545) | Tests/test support:+2733/-181(net+2552) | Docs:+39/-20(net+19).The positive production delta is the concrete lifecycle capability and its ownership/security boundaries: one generation service, a complete desktop-artifact fingerprint, contained reserved-marketplace ownership, exact physical-client retirement, per-home publication fencing, and exact-candidate reconciliation. The implementation removes the old completed-service path cache, reuses the existing exact-client retirement and managed-home identity helpers, and adds no compatibility shim or public configuration.
Maintainer judgment: this production growth is accepted as warranted for the lifecycle capability and its containment/compatibility boundaries. The accepted product contract is convergence for standard managed macOS desktop candidates, with active X work draining, new same-home work adopting Y, unrelated homes remaining independent, existing opt-outs preserved, and no request-hot-path polling.
Alternatives rejected:
stat/codesign polling: violates process-stable metadata ownership and adds hot-path latency;The optional shared plugin cache is serialized under the same per-home owner, fenced immediately before publication, and bound to the settled desktop epoch plus exact artifact source. The pathfinder cleanup closes the pre-existing same-version/source convergence gap without a sidecar or runtime polling.
Credit: #127024 by @bdjben identified the user-visible update failure and motivated the updater investigation.