Skip to content

fix(codex): stop Computer Use readiness stalls across fallbacks - #113393

Merged
fuller-stack-dev merged 2 commits into
mainfrom
codex/computer-use-readiness-owner
Jul 24, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
codex/computer-use-readiness-owner

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Related: #103250
Related: #113232

What Problem This Solves

Fixes an issue where users with strict Codex Computer Use readiness enabled could wait through the same two thread/start timeouts once per fallback model before any model work began when an isolated Codex home did not contain the desktop-bundled Computer Use service.

Why This Change Was Made

The Codex plugin now provisions the signed desktop Computer Use service into the exact Codex home before app-server startup, then reports strict readiness failures as a typed harness preflight that model fallback must not repeat. Empty Computer Use tool exposure fails before a live probe, while genuine Computer Use requests still fail closed when strict readiness is required.

Provisioning is scoped to the selected Codex home, stages and validates a complete service bundle before replacement, restores the prior bundle on failure, and coordinates concurrent installs in-process. This change does not add a persistent cache, weaken strict readiness, or broaden process cleanup.

AI-assisted: yes. The implementation was independently reviewed with the repository autoreview workflow, and all actionable findings are resolved.

User Impact

An unhealthy optional Computer Use integration no longer multiplies the same startup delay across every fallback model. On macOS, isolated Codex homes can use the signed service shipped by the selected ChatGPT or Codex desktop app. Computer Use remains fail-closed when strict readiness is enabled.

Maintainer Decisions

  • AgentHarnessPreflightError is approved as an additive Plugin SDK contract for model-independent harness startup failures that occur before provider/model work. Harnesses must not use it for provider, model, or authentication failures, which retain normal fallback behavior.
  • This PR is the canonical repair for the isolated-home readiness stall. fix(codex): prevent Computer Use timeouts in isolated homes #113232 remains useful independent context, but the two implementations must not land separately; its author and maintainers can decide whether any non-overlapping work remains after this merge.

Evidence

  • Fresh-main red/head timing probe with the same four-candidate fixture: base performed 8 readiness thread/start calls in 2,351 ms; proposed head performed 2 calls in 1,206 ms. The production timeout is 60 seconds per call, so the head removes six redundant calls without reducing the readiness retry count.
  • Focused tests: 267 passed (131 model-fallback assertions plus 136 Codex startup, auth bridge, readiness, and provisioning assertions).
  • Source-blind behavior proof covered a generic prompt, an explicit Computer Use path, genuine provider fallback, and one-vs-four-candidate readiness counts. Generic and Computer Use paths each ran one harness preflight; provider failures still advanced to the next model.
  • macOS bundle proof copied the actual desktop-shipped service into a disposable isolated Codex home; the executable was present and /usr/bin/codesign --verify --deep --strict passed.
  • Remote changed-surface proof passed pnpm check:changed, pnpm build, pnpm docs:check-mdx, and the plugin SDK surface check.
  • Direct upstream inspection confirmed both the installed Codex protocol and current Codex main await MCP initialization during thread/start, so repeated model attempts repeat the same readiness stall rather than testing a model-specific condition.
  • Independent autoreview completed with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts agents Agent runtime and tooling extensions: codex size: L maintainer Maintainer-authored PR labels Jul 24, 2026
@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 24, 2026, 4:09 PM ET / 20:09 UTC.

ClawSweeper review

What this changes

The PR copies the signed macOS Computer Use service into an isolated Codex home when auto-install is authorized, detects empty MCP tool exposure before live probes, and prevents model fallback from repeating a model-independent harness readiness failure.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for explicit maintainer review. The patch addresses a real Codex Computer Use startup failure and provides unusually strong implementation and runtime evidence, but it also adds a public Plugin SDK error contract that defines cross-plugin model-fallback behavior; that contract should receive an owner decision before merge. The PR is authored by a repository member and carries the protected maintainer label, so it is not eligible for automated cleanup.

Priority: P1
Reviewed head: 1f24e31797d53097faa8ee42dd166585351e7bd3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch and supplied behavior evidence are strong, with the remaining blocker being explicit ownership of the new public fallback contract and consolidation of overlapping work.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This repository-member PR is not subject to the external-contributor proof gate; nevertheless, the PR body supplies credible after-fix terminal and macOS bundle evidence, including a signed-service verification. Any posted diagnostic evidence should remain redacted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This repository-member PR is not subject to the external-contributor proof gate; nevertheless, the PR body supplies credible after-fix terminal and macOS bundle evidence, including a signed-service verification. Any posted diagnostic evidence should remain redacted.
Evidence reviewed 6 items Patch scope: The branch adds macOS Computer Use service provisioning before Codex app-server startup, changes empty MCP tool exposure into an immediate readiness failure, and converts readiness failures into a typed harness preflight that bypasses model fallback retries.
Fallback boundary: The fallback runner rethrows AgentHarnessPreflightError before provider-error normalization, so a local harness readiness failure cannot be retried for each candidate model.
Public SDK contract: The new AgentHarnessPreflightError is exported from the public agent-harness runtime barrel and the generated SDK baseline changes, making its semantics an additive Plugin SDK contract rather than an internal Codex-only detail.
Findings None None.
Security None None.

How this fits together

A Codex-mode agent turn enters OpenClaw’s model-fallback runner, which starts the Codex app server and performs Computer Use readiness checks before a model attempt begins. This PR changes that handoff so local, model-independent readiness failures terminate fallback once while macOS isolated homes can receive the required desktop-bundled service.

flowchart LR
  A[Agent turn request] --> B[Model fallback runner]
  B --> C[Codex harness startup]
  C --> D[Isolated Codex home]
  D --> E[Computer Use service and MCP readiness]
  E -->|ready| F[Model attempt]
  E -->|model-independent failure| G[Typed preflight error]
  G --> H[Stop repeated fallback probes]
Loading

Decision needed

Question Recommendation
Should OpenClaw make AgentHarnessPreflightError a public Plugin SDK contract for all model-independent harness startup failures, and should this branch be the canonical resolution instead of the overlapping open implementation? Approve the generic preflight contract: Keep the public typed error, document its model-independent fallback semantics, and reconcile or supersede the overlapping Codex implementation before landing.

Why: The patch’s fallback behavior is technically coherent, but exporting a new SDK error class commits the project to semantics that other plugins may depend on; choosing between overlapping live branches is also a maintainer ownership decision.

Before merge

  • Resolve merge risk (P2) - The additive public AgentHarnessPreflightError contract establishes a cross-plugin rule that suppresses model fallback. Its intended scope, documentation, and long-term SDK ownership need explicit maintainer agreement before merge.
  • Resolve merge risk (P1) - This PR overlaps materially with the still-open fix(codex): prevent Computer Use timeouts in isolated homes #113232. Landing both independently risks duplicated service-provisioning logic or divergent readiness semantics unless maintainers choose a canonical implementation or reconcile the branches.
Agent review details

Security

None.

PR surface

Source +274, Tests +264, Docs +6, Generated 0, Other +1. Total +545 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 8 287 13 +274
Tests 5 278 14 +264
Docs 1 8 2 +6
Config 0 0 0 0
Generated 1 1 1 0
Other 1 2 1 +1
Total 16 576 31 +545

Review metrics

Metric Value Why it matters
Plugin SDK error surface 1 added public error contract The new exported preflight error changes the shared plugin-to-core fallback contract and merits explicit compatibility ownership.

Merge-risk options

Maintainer options:

  1. Confirm the public fallback contract before merge (recommended)
    Obtain explicit approval for the SDK error semantics and reconcile the overlapping Computer Use branch so plugin callers have one documented compatibility path.
  2. Accept the additive SDK surface intentionally
    Maintainers may accept the new exported error as the generic plugin contract, provided its fallback implications and related-PR ownership are recorded in the review.
  3. Pause for consolidation
    Pause this branch if maintainers prefer the related PR as the canonical place for isolated-home provisioning and readiness behavior.

Technical review

Best possible solution:

Adopt one canonical isolated-home Computer Use implementation, retain the typed preflight path only if maintainers approve it as a generic Plugin SDK contract, and merge with focused regression coverage for both generic fallback and explicit Computer Use turns.

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

Yes, from source and the PR’s real-run evidence: enable strict Codex Computer Use readiness in an isolated macOS Codex home lacking the desktop service, configure multiple fallback models, and observe that the same startup/readiness probes repeat per candidate. I could not independently execute the path because the read-only command sandbox rejected all repository commands.

Is this the best way to solve the issue?

Unclear until maintainers decide the Plugin SDK boundary. The typed preflight mechanism is a focused way to stop genuinely model-independent retries, but a public fallback-control contract and the overlap with #113232 need one canonical owner decision.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Strict Computer Use readiness can block real Codex agent turns and multiply startup delays across fallback candidates.
  • add merge-risk: 🚨 compatibility: The patch adds an exported Plugin SDK error type whose semantics determine whether fallback proceeds for all plugin harnesses.
  • add merge-risk: 🚨 auth-provider: The changed fallback path sits between Codex app-server startup/auth preparation and provider/model selection, so an overly broad classification could suppress legitimate provider fallback.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This repository-member PR is not subject to the external-contributor proof gate; nevertheless, the PR body supplies credible after-fix terminal and macOS bundle evidence, including a signed-service verification. Any posted diagnostic evidence should remain redacted.

Label justifications:

  • P1: Strict Computer Use readiness can block real Codex agent turns and multiply startup delays across fallback candidates.
  • merge-risk: 🚨 compatibility: The patch adds an exported Plugin SDK error type whose semantics determine whether fallback proceeds for all plugin harnesses.
  • merge-risk: 🚨 auth-provider: The changed fallback path sits between Codex app-server startup/auth preparation and provider/model selection, so an overly broad classification could suppress legitimate provider fallback.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This repository-member PR is not subject to the external-contributor proof gate; nevertheless, the PR body supplies credible after-fix terminal and macOS bundle evidence, including a signed-service verification. Any posted diagnostic evidence should remain redacted.

Evidence

What I checked:

  • Patch scope: The branch adds macOS Computer Use service provisioning before Codex app-server startup, changes empty MCP tool exposure into an immediate readiness failure, and converts readiness failures into a typed harness preflight that bypasses model fallback retries. (extensions/codex/src/app-server/auth-bridge.ts:439, 1f24e31797d5)
  • Fallback boundary: The fallback runner rethrows AgentHarnessPreflightError before provider-error normalization, so a local harness readiness failure cannot be retried for each candidate model. (src/agents/model-fallback.ts:418, 1f24e31797d5)
  • Public SDK contract: The new AgentHarnessPreflightError is exported from the public agent-harness runtime barrel and the generated SDK baseline changes, making its semantics an additive Plugin SDK contract rather than an internal Codex-only detail. (src/plugin-sdk/agent-harness-runtime.ts:64, 1f24e31797d5)
  • Current upstream dependency contract: Codex app-server documents thread/start as the thread-opening API and publishes MCP startup-state notifications, supporting the patch’s distinction between app-server/MCP readiness and a model-specific provider failure. (../codex/codex-rs/app-server/README.md, main)
  • Behavior evidence supplied with the PR: The PR body reports a fresh-base versus head timing probe, focused tests, macOS signed-bundle copy and codesign verification, and remote changed-surface validation. This is meaningful real behavior proof, though it does not replace the required maintainer decision on the new SDK contract. (1f24e31797d5)
  • Related open implementation: The related PR fix(codex): prevent Computer Use timeouts in isolated homes #113232 also implements service provisioning and readiness changes for isolated Codex homes, but it remains open; neither branch is a safe superseding close target yet. (2c4ca02d2f50)

Likely related people:

  • fuller-stack-dev: The repository identifies this author as a MEMBER, and both commits on this branch implement the affected Codex startup, readiness, and fallback path; confidence is limited because the read-only command sandbox prevented the required broader local history pass. (role: repository member and current Codex Computer Use contributor; confidence: medium; commits: e01d17cc62c8, 1f24e31797d5; files: extensions/codex/src/app-server/auth-bridge.ts, extensions/codex/src/app-server/computer-use-service.ts, src/agents/model-fallback.ts)
  • bdjben: The open related PR fix(codex): prevent Computer Use timeouts in isolated homes #113232 covers the same isolated-home service provisioning and Computer Use readiness domain, making this contributor a useful comparison and coordination point rather than an owner of this branch. (role: adjacent implementation contributor; confidence: medium; commits: 2c4ca02d2f50; files: extensions/codex/src/app-server/computer-use-service.ts, extensions/codex/src/app-server/computer-use.ts)

Rank-up moves

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

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.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Maintainer decision recorded in the PR body: the narrowly scoped public AgentHarnessPreflightError contract is approved, and #113393 is selected as the canonical isolated-home readiness repair. Provider/model/authentication failures remain outside the preflight contract and retain normal fallback behavior. I also recorded the canonical selection on #113232 so the overlapping implementations are not landed independently.

@fuller-stack-dev
fuller-stack-dev merged commit ee606de into main Jul 24, 2026
161 of 169 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the codex/computer-use-readiness-owner branch July 24, 2026 20:27
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 25, 2026
…claw#113393)

* fix(codex): bound computer use readiness preflight

* chore(codex): keep service status internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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.

1 participant