Skip to content

fix: honor foreground node command timeouts in Codex - #149267

Merged
steipete merged 5 commits into
mainfrom
codex/node-exec-timeout-policy
Sep 15, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/node-exec-timeout-policy

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes foreground node commands being cut off by OpenClaw's Codex adapter after 90 seconds, or after 600 seconds with a longer explicit command timeout. The enclosing app-server watchdog could also stop the request at 660 seconds.

User Impact

node_exec follows the exec tool's configured, per-agent, runtime, and per-call command budget. Ordinary dynamic tools retain the 90-second default and 600-second cap. Per-call zero disables only the process timer; node transport waits stay bounded, and Stop, turn deadlines, and authority expiry remain effective. No configuration migration is needed. This behavior ships as a core-and-Codex-plugin update; upgrade both together.

Why This Change Was Made

The actual exec tool carries its resolved node wait budget through lazy tools and target projection. Node execution and its metadata share one timeout calculation. The owning Codex handler hands that budget to the app-server watchdog once, with completion grace at each outer layer. Node watchdogs use the same safe timer ceiling, including saturated overrides.

The timer helper is exposed through the existing private-local number-runtime facade, not a new typed-public SDK subpath. The normal release workflow raises official plugin openclaw.compat.pluginApi floors and build versions to the core release version; packaged peer metadata uses that floor, and installation rejects an older host API before loading the plugin. A Codex-only publication containing these imports must not retain an older API floor. Source checkouts should pair core and plugin from the same checkout.

This follows the existing release compatibility contract, version-sync owner, and install admission check.

Follow-up to #148508 for foreground node execution.

Evidence

  • Full live Codex → isolated Gateway → paired node suite passed: default command 105,008 ms, explicit command 690,004 ms, zero plus Stop with process extinction, and a two-second process timeout. Exact persisted call arguments, correlated results, runtime identity, node placement, timestamps, and process cleanup were checked.
  • 399 focused agent tests and a 62-case integration rerun passed. CI also exposed stale fixtures from earlier main changes; those repairs have since landed independently, including fix: PR workflow tests fail during repository identity checks #149294, and this branch now uses them without carrying duplicate changes. The final cleanup/identity audit passed 173 selected tests with existing assertions and deadlines unchanged.
  • Local type checks, lint, repository guards, builds, and independent reviews through P2 completed. The timeout implementation and its callers are unchanged from the live-tested code after rebasing.
  • 9 release/packaging compatibility checks passed: API-floor version sync, matching/older-host admission, and generated peer metadata for publishable plugins. The live suite also passed packaged plugin setup and the update-finalize repair path with the matching candidate core/plugin pair.
  • Regressions reproduce the original 90/600/660-second failures and protect the timer ceiling. Canonical exact-head CI passed.

The canonical run encountered a long Blacksmith 32-vCPU runner queue, so the native capacity fallback was also dispatched. Its supplemental Windows job hit the existing 120-second limit in vitest-worker-artifacts.test.ts (builds changed source despite valid stale dist and fails visibly on build errors). That test, its runner/compiler, fixture helpers and SQLite execution path are unchanged by this PR and do not invoke Codex or node_exec. One initial compile alone took 40.95 seconds for 9,373 inputs/13,829 outputs; the case copies that tree and performs several more builds. This is a separate Windows fixture throughput gap, not proof of a node timeout regression. No retry, skip or deadline increase was used to mask it. The compiled corpus includes changed source files, so this does not claim identical compile cost or a proven precise stall phase.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: L maintainer Maintainer-authored PR labels Sep 15, 2026
@steipete
steipete marked this pull request as ready for review September 15, 2026 16:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 2:28 PM ET / 18:28 UTC (Revision 3).

ClawSweeper review

What this changes

The PR carries remote-node command timeouts through OpenClaw’s Codex adapter, preserving configured defaults, explicit overrides, and cancellation, with documentation and regression coverage.

Merge readiness

✅ Ready for maintainer review

This fix remains necessary on current main. No blocking patch defects were found, and the recorded live observations and documented core/plugin rollout address the earlier compatibility concern.

Priority: P2
Reviewed head: 5e2a917fb55ed2082eab6a720ffeb8086f7261e4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful live coverage, regression checks, and an explicit rollout contract.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded real Codex → packaged plugin → isolated Gateway → paired-node observations show completion beyond both former cutoff points, a two-second process timeout, and explicit Stop killing a zero-timeout process; the inspected live test matches those production paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded real Codex → packaged plugin → isolated Gateway → paired-node observations show completion beyond both former cutoff points, a two-second process timeout, and explicit Stop killing a zero-timeout process; the inspected live test matches those production paths.
Evidence reviewed 10 items Current main still needs the fix: The fetched main resolver has no node_exec owner-budget path: ordinary calls still receive the 90-second default, 600-second cap, and enclosing 660-second request watchdog.
Latest release comparison: GitHub contents for v2026.9.4 also retain the ordinary timeout constants and have no node_exec-specific resolver. The local release blob was unavailable; the read-only GitHub fallback succeeded.
Single timeout owner: The shared resolver preserves existing node command and transport calculations. Both lazy and concrete exec tools expose that budget, and target projection pins the metadata arguments consistently with execution.
Findings None None.
Security None None.

How this fits together

The Codex adapter forwards model-requested tools to OpenClaw. For remote commands, the exec tool sends work through the Gateway to a paired node, then returns the result through two adapter watchdogs.

flowchart LR
  A[Codex tool request] --> B[Matching thread and turn]
  B --> C[Exec timeout policy]
  C --> D[Tool and request watchdogs]
  C --> E[Gateway node invocation]
  E --> F[Paired node command]
  F --> D
  D --> G[Result returned to Codex]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +87, Tests +720, Docs +18. Total +825 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 13 177 90 +87
Tests 7 721 1 +720
Docs 2 18 0 +18
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 916 91 +825

Review metrics

Metric Value Why it matters
Production versus test growth Production +87 net lines; tests +720 net lines Production growth carries one shared timeout policy through existing owners; most added coverage exercises watchdog boundaries and the real Gateway/node flow.

Technical review

Best possible solution:

Keep one exec-owned command budget across adapter layers and ship the supporting core and Codex plugin together under the documented API-floor contract.

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

Yes: current main routes foreground node commands through the 90-second default or 600-second dynamic-tool cap despite longer exec budgets. This review established the mechanism from source without executing it.

Is this the best way to solve the issue?

Yes: reusing the exec owner’s resolved budget avoids competing timeout policy, and the patch preserves bounded transport waits, cancellation, and existing configuration semantics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6d158d08d0c2.

Labels

Label justifications:

  • P2: This repairs bounded long-running remote-node command failures in the Codex adapter without evidence of a broader urgent outage.
  • 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. Sufficient (live_output): Recorded real Codex → packaged plugin → isolated Gateway → paired-node observations show completion beyond both former cutoff points, a two-second process timeout, and explicit Stop killing a zero-timeout process; the inspected live test matches those production paths.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real Codex → packaged plugin → isolated Gateway → paired-node observations show completion beyond both former cutoff points, a two-second process timeout, and explicit Stop killing a zero-timeout process; the inspected live test matches those production paths.

Evidence

What I checked:

  • Current main still needs the fix: The fetched main resolver has no node_exec owner-budget path: ordinary calls still receive the 90-second default, 600-second cap, and enclosing 660-second request watchdog. (extensions/codex/src/app-server/dynamic-tool-execution.ts:510, 6d158d08d0c2)
  • Latest release comparison: GitHub contents for v2026.9.4 also retain the ordinary timeout constants and have no node_exec-specific resolver. The local release blob was unavailable; the read-only GitHub fallback succeeded. (extensions/codex/src/app-server/dynamic-tool-execution.ts:506, 3a9d69db306c)
  • Single timeout owner: The shared resolver preserves existing node command and transport calculations. Both lazy and concrete exec tools expose that budget, and target projection pins the metadata arguments consistently with execution. (src/agents/exec-tool-timeout.ts:10, 5e2a917fb55e)
  • Watchdog propagation and cancellation: The admitted handler supplies the resolved budget to the request watchdog once. Settled or aborted requests cannot extend it, and the router checks the matching route’s cancellation signal before forwarding budget changes. (extensions/codex/src/app-server/client.ts:1036, 5e2a917fb55e)
  • Recorded real behavior: The captured PR body reports real Codex → isolated Gateway → paired-node completion at 105,008 ms and 690,004 ms, plus explicit chat.abort causing zero-timeout process extinction and a two-second command timeout. The inspected live test checks exact persisted arguments, correlated tool results, runtime identity, node placement, and cleanup. The September 15 comment confirms packaged setup/update-finalize coverage: fix: honor foreground node command timeouts in Codex #149267 (comment). Evidence is from the supplied snapshot, sourceRevision e891afe937c867ed45081bcdf78dfaeeb958280af5f7d784f7bbd4d628d2e37a; this review did not execute tests. (test/e2e/qa-lab/runtime/gateway-node-exec-timeout.live.test.ts:319, 5e2a917fb55e)
  • Compatibility concern addressed: The new helper uses the existing private-local number-runtime facade. The PR explicitly requires a matched core/plugin release; release version synchronization raises plugin API floors, and installation rejects incompatible hosts. The discussion records nine packaging/admission checks and matching-candidate setup/update proof. Public docs: docs/reference/RELEASING.md. (docs/reference/RELEASING.md:638, 5e2a917fb55e)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-15T16:57:18.740Z sha 4638d04 :: blocked before merge. :: none
  • reviewed 2026-09-15T17:49:41.583Z sha ca5c41a7aa1e5666f328ad35b3b8cc50019acf5b :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/node-exec-timeout-policy branch from 4638d04 to ca5c41a Compare September 15, 2026 17:42
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 15, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The PR description now records the core/plugin rollout contract and the completed live evidence.

number-runtime is an existing private-local runtime facade for official plugins. The release workflow raises openclaw.compat.pluginApi and build metadata to the core release version; generated peer metadata uses that floor, and install admission rejects an older host API before plugin loading. This change must ship with its supporting core release. A Codex-only publication containing the new imports cannot retain an older API floor. The existing release contract and source owners are linked in the PR body.

Verification: the full real Codex → packaged plugin setup/update-finalize → isolated Gateway → paired node suite passed all four cases, including 690,004 ms execution and Stop killing a zero-timeout process. Nine focused release/packaging checks also passed for version synchronization, compatible/incompatible host admission, and generated plugin peer metadata. These checks support the matched core/plugin release path; they do not claim that a new plugin can load on an older unsupported core.

@steipete
steipete force-pushed the codex/node-exec-timeout-policy branch from ca5c41a to 5e2a917 Compare September 15, 2026 18:18
@steipete
steipete merged commit 6872be8 into main Sep 15, 2026
400 of 403 checks passed
@steipete
steipete deleted the codex/node-exec-timeout-policy branch September 15, 2026 19:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
* fix: honor foreground node command timeouts in Codex

* test: separate foreground node timeout coverage

* test: keep live node cleanup requests awaitable

* test: verify public node results in live proof

* test: assert the node stop cancellation envelope
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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