Skip to content

feat: run Code Mode on Node or isolated QuickJS - #154522

Merged
steipete merged 14 commits into
mainfrom
codex/code-mode-executors
Sep 22, 2026
Merged

steipete merged 14 commits into
mainfrom
codex/code-mode-executors

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #153889. Follow-up to #154001 and #154209.

What Problem This Solves

Code Mode currently couples tool orchestration to QuickJS-WASI, so operators cannot choose trusted Node execution or retain hardened guest isolation through a separate executor.

User Impact

Code Mode stays opt-in. When enabled, its default executor becomes Node.js node:vm in a worker thread. This is an intentional trusted-host execution choice: node:vm is not a security boundary and runs with the Gateway's OS privileges. Calls through OpenClaw tools retain their normal authorization and approvals; those checks cannot contain code that escapes the Node VM context.

Operators can select the bundled QuickJS executor with tools.codeMode.executor: "quickjs", per-agent configuration, or the new Settings → Agents & Tools → Labs → Code Mode executor control. QuickJS has no ambient host APIs and retains its existing guest isolation and limits. Explicit legacy runtime: "quickjs-wasi" settings migrate to executor: "quickjs"; configurations without an explicit runtime adopt Node. Selected bundled QuickJS remains available under general plugin disablement or restrictive allowlists, preserving the former core capability without enabling unrelated plugins. An explicit deny or disabled entry for its owner still blocks it; external executors retain normal plugin policy. Unavailable selected executors fail explicitly without fallback. Activation and existing tool limits remain separate from executor selection.

Why This Change Was Made

Core continues to own the JavaScript tool surface, typed discovery, tool dispatch and approvals, results, settlement, cancellation, and expiry. Executors own execution and suspended state. Node retains a live worker/context across wait; QuickJS owns its WASM implementation, dependency, worker, and serialized snapshots in a bundled plugin. A run keeps its selected executor through all resumes, and cleanup joins worker execution and continuation disposal before releasing ownership.

Node compiles fixed controller scripts once per worker while creating a fresh context for every cell. Tool exchange still drains guest promises under a timeout before admitting queued calls.

The dedicated executor guide, existing Code Mode documentation, config help, and SECURITY.md describe the supported boundaries. Node's V8 heap budget is best-effort, includes runtime allocations, and excludes external buffers and total RSS; maxSnapshotBytes continues to bound QuickJS snapshots, not live Node heaps. The real-model matrix now accepts an explicit executor for Gateway-backed tasks and records it in the evidence.

Evidence

Current head f6e1b0b888ff15985f4b3bbe9780feaac6ff6bb0 integrates main 48883d72753bfe7f90ce6871b2cc8b41b9c789da. Only the generated config checksum conflicted. Independent audit and the lead each verified all 148 introduced file patches remain identical to the previously reviewed feature, excluding that regenerated checksum. Upstream agent schema 23, transcript-codec reading in the model matrix, the SQLite worker build entry, and assertion-baseline reductions are preserved. Canonical generation (48.872 seconds) and config verification (27.796 seconds) passed on exact final tree 142e24bdac28088fb0d1e9f55f7b8467f070202a; the two synthetic Gateway producer/transcript-reader cases passed in 16.219 seconds. This is integration proof, not a new real-engine/model benchmark. Existing engine, package, upgrade, and live-model proof keeps its original attribution and remains applicable to the unchanged feature. Final-head hosted gates remain required before landing.

The first CI attempt for 8801849b5dea failed only in the existing session-owner-filter empty-section case: the involving-me view retained eight groups instead of one. The filter/controller source is unchanged by this PR. One original-order replay of exact CI merge 67c7f11b333a462b57c6d48f42c069b5fcdfbf46 passed all 53 files / 235 tests in 284.685 seconds, using Node 24.19.0, Playwright 1.63.0, Chromium 153.0.8010.12, 16 CPUs, and the unchanged two-worker configuration. All test files were byte-identical; a temporary helper-only diagnostic patch recorded the selection, scoped sessions.list request, and one-row response. The fresh AWS host and passive instrumentation differ from the original hosted timing. This is a non-reproduced failure, not a claimed fix; no production code, assertion, or timeout changed. The original failure is retained. One targeted hosted rerun with debug logging also passed on the same head; its browser-test step took 503 seconds. Both replays are non-reproductions, not claimed fixes.

Previous head 8801849b5dea2aac55bc1babf449061ebcbf9377 integrates main 1b90b88f7eb81662f481653d9e16fd21acac6f58 and canonically regenerates the sole conflicting config checksum. Its feature delta is byte-identical after normalizing patch locations to the fully reviewed 900c2a6fe338769287ef812bf974fd44411d0fa3 candidate, except for the generated checksum. Both the independent merge audit and the lead verified that equivalence. The canonical generator and config check passed on final tree 85ae3fb323db3a3c67e458170820c2bcf2443461; no repeated runtime proof is claimed for this mechanical refresh.

Head 900c2a6fe338769287ef812bf974fd44411d0fa3 passed all hosted CI, a fresh full two-pass review, and focused remote integration proof on tree 735b17ee75e684c24ae6d6bad32c580302ca400e: 163 tests covering both engines and resolver policy, config verification, core and affected test types, SDK surface, and plugin inventory. Executor source and dependencies were unchanged in that integration. Current-head CI remains required before landing.

Exact head 667a9ebe1b248b75622bf2168e84123129d4feca passed CI and the combined security gate. The native completed-gate preparation passed against this head.

The CI follow-up 667a9ebe1b248b75622bf2168e84123129d4feca / tree 60f5c24773a69077ffee651a05be471b1335b604 removes a test-table map-spread lint violation and moves the existing 60 System Agent type-test roots into the existing services shard. Coverage remains exact once-only for all 12,248 roots; shard counts are 641 and 495, with the 700 cap unchanged. Targeted lint, all 24 shard-invariant cases (32.99 seconds with --maxWorkers=1), both affected type graphs, and independent review passed. The unrelated upstream rendered-code test mismatch is fixed on main by 087ccde18c3042c902a575e76b4bbdce97f71ca7; no duplicate repair is included here. A separate unchanged SQLite reclamation test observed zero optional cleanup progress in CI. One replay of its exact CI merge and original 86-pattern group passed 1,554 tests with the same single skip in 168.07 seconds on Node 24.19.0 with two workers; the failing case passed. This remains non-reproduced, not claimed fixed, with no storage behavior or assertion changes.

The previously reviewed be77c0c495db4a7881326bb87b6992c540de2a35 head passed all hosted CI/security checks. The landing update merges main at d61156bb5cfa22e15d19121d6ab4c073bfeac33e, preserves its early JavaScript syntax-admission fix, and extends the affected guest regressions to both executors. Canonical config checksums were regenerated. Selectable executor IDs are explicitly documented as core-owned node and plugin-supplied quickjs; plugin installation IDs are separate. Final candidate 82674abd2d72a6304eb5e5e6079828828c8cf46e / tree 263149c4a3a83b2ec6dabf592a0962d1509f8500 passed fresh independent review and focused remote proof: 33 guest cases, 99 runtime cases, the headless syntax case, affected test types, SDK surface, and plugin inventory. The changed guest suite took 33.74 seconds with --maxWorkers=1 on an AWS 8-vCPU worker. The replacement head and subsequent CI correction passed the hosted gates linked above.

The clean da2dc8267a36 candidate passed production typechecking, lint, SDK/config/core graph guards, import-cycle checks, a canonical private-QA build (320.3 seconds), and a separate canonical public build with tarball integrity and clean npm installation. The broader affected regression pass covered 1,164 cases; later focused runtime passes covered 249 and 254 cases. Timeout output, cancellation, retained-state cleanup, worker heap budgeting, and cross-cell encoding isolation have direct regression coverage.

Both real OpenAI gpt-5.6-luna JavaScript-contract trials passed on their first attempt, with Code Mode engagement, task behavior, and interview consistency verified for Node and QuickJS. These single functional trials do not establish a model-latency advantage. Installed-package probes separately verified bridge dispatch, park/resume, lexical state, Unicode encoding, plugin-owned WASM assets, and explicit failures before dispatch for missing/corrupt copied assets.

Six installed agent exec selection cases passed through a scripted loopback provider: Node default, QuickJS under global plugin disablement and restrictive allowlists, per-agent override, explicit owner denial, and explicit owner disablement. The published 2026.9.4 updater → 2026.9.5 candidate passed three upgrade cases preserving explicit QuickJS, implicit Node selection, global/per-agent activation and limits, plugin policy, roster migration, and original backups; all three migrated configurations then selected the expected engine through the installed CLI. The first strict-allowlist fixture observed unrelated Codex Doctor activation; its existing explicit opt-out isolated that behavior without weakening assertions.

Rebase proof passed 92 worker GC/retention/lifecycle/state/wait/session cases on 51e48c948e1, then 20 plugin resolver cases on af0649e6bc2. Executor source stayed unchanged. Hosted CI exposed integration omissions; repairs passed fresh independent Codex review and focused remote checks: zero type/import cycles, 13 boundary cases, seven QuickJS lifecycle cases, affected production/test types, SDK surface, generated inventory, static-asset metadata, labeler coverage, and the curated-settings browser E2E. UI screenshots below were inspected, delivered in chat, and verified rendering in this PR.

Same-host source-loaded microbenchmarks (Linux, Node 24): warm Node cells with 0/32/256 tools take 1.47/2.00/5.00 ms, versus 3.46/4.43/11.55 ms for QuickJS. The 128-call sequential bridge workload takes 89.0 ms on Node versus 42.1 ms on QuickJS; caching fixed controller scripts and removing a redundant timed evaluation improved Node from 109.7 ms. These are executor microbenchmarks, not model response time or packaged cold-start measurements.

The hosted run also observed a maintenance-heartbeat loss in an unchanged state-migration test. One original-order replay of the same 56-pattern infra group on Node 24.19.0 with two workers passed all 1,356 tests and the same seven skips in 594.55 seconds, including the failing case; the heartbeat failure remains non-reproduced, not claimed fixed. The AWS host has 32 cores versus eight in CI. The exact CI Bun binary reproduced a missing public SDK import in the source worker before guest execution. Test extraction had changed automatic suite selection; the existing owner-routing mechanism restores the six cases to the Node agent-runtime suite, with assertions unchanged. All six integration cases and all 17 routing-regression cases passed on final tree 5a0fcaaa51cdc57f131c323e128471e9adbcf7c2; the canonical runner selected Node 24.19.0 without an override. All three repair batches passed independent Codex review. Security Review hit a file-fetch HTTP 429 and later Actions-installation rate-limit 403s. Required final-head GitHub CI/security/review gates remain enforced separately from the recorded remote proof above.

Focused test cost

Measured with pnpm test <file> --maxWorkers=1 on the same AWS host. Wall time includes compiler and runner startup. Worker termination, encoding isolation, and real VM snapshot tests require the actual engines. Mechanical teardown changes reuse the recorded broader-suite results. Relocated QuickJS cases were measured after moving them to their owning suites. Additional repair proof: the static-asset inventory case took 3.12 seconds, labeler coverage 2.26 seconds, and the curated-settings browser E2E 23.45 seconds. These focused timings are reported separately from the full-file costs below. Exact final-head CI and security gates passed as linked above.

File Wall seconds
src/agents/code-mode-node.test.ts 13.31
src/agents/code-mode-node.lifecycle.test.ts 13.22
src/agents/code-mode-executor.test.ts 2.23
src/agents/code-mode-state.test.ts 15.90
src/agents/code-mode-headless.budget.test.ts 16.23
src/agents/code-mode-headless.cancellation.test.ts 16.70
src/agents/code-mode-worker-lifecycle.test.ts 15.77
src/plugins/code-mode-executor.test.ts 15.33
src/agents/code-mode-quickjs.integration.test.ts 35.93
src/agents/code-mode-quickjs.worker-lifecycle.test.ts 26.19
extensions/code-mode-quickjs/src/live-vm.test.ts 20.48
extensions/code-mode-quickjs/src/worker-lifecycle.test.ts 21.95
src/agents/code-mode.config.test.ts 1.97
src/config/zod-schema.code-mode.test.ts 2.15
src/commands/doctor/shared/legacy-config-migrations.runtime.code-mode.test.ts 14.70
extensions/qa-lab/src/code-mode-model-matrix.options.test.ts 2.33
ui/src/pages/labs/labs-page.test.ts 3.98
test/vitest-unit-fast-config.test.ts 8.28

Settings screenshots

Before:

Code Mode settings before the executor selector

After, with Node selected by default:

Code Mode settings with the Node executor default

After selecting QuickJS and reloading:

Code Mode settings retaining the saved QuickJS executor

@clawsweeper

clawsweeper Bot commented Sep 21, 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 app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: qa-lab extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 06:48
@steipete
steipete requested a review from a team as a code owner September 21, 2026 06:48
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: f6e1b0b888ff15985f4b3bbe9780feaac6ff6bb0
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • pnpm-lock.yaml
  • extensions/code-mode-quickjs/package.json
  • package.json

Carefully review these changes before merging.

@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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 21, 2026, 8:09 PM ET / September 22, 2026, 00:09 UTC (Revision 13).

ClawSweeper review

What this changes

Adds selectable Node and QuickJS execution for Code Mode, moves QuickJS into a bundled plugin, migrates explicit legacy settings, and adds a Settings selector.

Merge readiness

⛔ Blocked before merge - 5 items remain

This remains useful, distinct work: current main and v2026.9.5 still use QuickJS-only execution. No blocking correctness defect was found in the inspected changes.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with substantial runtime and upgrade evidence and no identified blocking code defect; required owner approval remains separate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The identity-matched body records both executors working through real-model and installed-package entrypoints, successful dispatch and resume, explicit-denial cases, and three published-updater migrations. Selected production files are unchanged since the previous review; screenshot access was unavailable to this reviewer and does not invalidate the runtime evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The identity-matched body records both executors working through real-model and installed-package entrypoints, successful dispatch and resume, explicit-denial cases, and three published-updater migrations. Selected production files are unchanged since the previous review; screenshot access was unavailable to this reviewer and does not invalidate the runtime evidence.
Evidence reviewed 10 items Pinned introduction and review continuity: Reviewed the introduced delta from 48883d7 to the pinned head. A separate comparison against the previous reviewed head found no changes in the selected executor, continuation, migration, Settings, QuickJS, or security-policy files. The supplied test merge is stale and was not used to infer merged behavior.
Still necessary on main and the latest release: Fetched main retains runtime: "quickjs-wasi". Reading the runtime file through GitHub at v2026.9.5 also found that fixed runtime, rather than selectable executors. The related merged JavaScript simplification and preparation optimization do not implement this executor choice.
Intentional default and upgrade contract: The maintainer-authored description explicitly chooses trusted Node execution for configurations without an explicit runtime. The migration preserves explicit QuickJS selections, existing executor values, activation, and limits. This is a documented intentional tradeoff, not an accidental fallback removal.
Findings None None.
Security None None.

How this fits together

Code Mode lets agents compose OpenClaw tools using JavaScript. Core manages tool permissions, results, and run ownership, while the selected executor runs the JavaScript and retains suspended execution.

flowchart TD
  A[Agent JavaScript] --> B[Code Mode controller]
  C[Operator configuration] --> D[Executor selection]
  B --> D
  D --> E[Node worker]
  D --> F[QuickJS plugin]
  E --> G[Authorized tool bridge]
  F --> G
  G --> H[Results or suspended continuation]
Loading

Decision needed

Question Recommendation
Does SecOps approve SECURITY.md documenting Node Code Mode as trusted host execution, including its default for configurations without an explicit runtime? Approve the documented boundary: Have an independent SecOps reviewer approve the current security-policy change after considering the recorded runtime and upgrade evidence.

Why: The maintainer has stated the intended tradeoff, but the separately enforced security-policy owner must approve this documentation change.

Before merge

  • Resolve merge risk (P1) - The SECURITY.md trust-boundary change still lacks the independent SecOps approval required by current code-owner rules.
  • Complete next step (P2) - Obtain independent openclaw/openclaw-secops approval for the SECURITY.md change under the live code-owner review rules.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Executor configuration 2 executor choices; 1 migrated setting The former runtime setting becomes an executor choice, with explicit QuickJS selections preserved.
Production versus test growth Production/tooling +1,382 net lines; tests/support +1,517 net lines Production growth is justified by the Node executor and shared executor lifecycle; the counts exclude documentation and metadata.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/legacy-config-migrations.runtime.code-mode.ts, unknown-data-model-change: src/config/schema.help.runtime.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete independent SecOps review (recommended)
    Obtain the required code-owner approval for the documented Node trust boundary while retaining the recorded migration and runtime evidence.

Technical review

Best possible solution:

Retain shared tool authorization and executor-owned lifecycle, preserve explicit QuickJS choices during upgrade, and land the documented trust boundary with independent SecOps approval.

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

Not applicable as a bug reproduction: this adds an executor choice. Current main and the latest release confirm the existing QuickJS-only behavior.

Is this the best way to solve the issue?

Yes: keeping orchestration and authorization in core while moving QuickJS behind a documented executor contract provides a coherent ownership boundary; the intentional Node trust model remains subject to security-owner approval.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 73f058a4e653.

Labels

Label justifications:

  • P2: This is a bounded improvement to opt-in Code Mode, without evidence of an urgent current-user regression.
  • merge-risk: 🚨 compatibility: The intentional default changes to Node and the public executor contract expands; explicit legacy choices have migration and published-updater evidence.
  • merge-risk: 🚨 security-boundary: Node execution intentionally shares Gateway OS privileges, and the corresponding security-policy change requires independent SecOps approval.
  • 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): The identity-matched body records both executors working through real-model and installed-package entrypoints, successful dispatch and resume, explicit-denial cases, and three published-updater migrations. Selected production files are unchanged since the previous review; screenshot access was unavailable to this reviewer and does not invalidate the runtime evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The identity-matched body records both executors working through real-model and installed-package entrypoints, successful dispatch and resume, explicit-denial cases, and three published-updater migrations. Selected production files are unchanged since the previous review; screenshot access was unavailable to this reviewer and does not invalidate the runtime evidence.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the introduced delta from 48883d7 to the pinned head. A separate comparison against the previous reviewed head found no changes in the selected executor, continuation, migration, Settings, QuickJS, or security-policy files. The supplied test merge is stale and was not used to infer merged behavior. (f6e1b0b888ff)
  • Still necessary on main and the latest release: Fetched main retains runtime: "quickjs-wasi". Reading the runtime file through GitHub at v2026.9.5 also found that fixed runtime, rather than selectable executors. The related merged JavaScript simplification and preparation optimization do not implement this executor choice. (src/agents/code-mode-runtime.ts:41, 73f058a4e653)
  • Intentional default and upgrade contract: The maintainer-authored description explicitly chooses trusted Node execution for configurations without an explicit runtime. The migration preserves explicit QuickJS selections, existing executor values, activation, and limits. This is a documented intentional tradeoff, not an accidental fallback removal. (src/commands/doctor/shared/legacy-config-migrations.runtime.code-mode.ts:40, f6e1b0b888ff)
  • Continuation and authorization ownership: Continuations have one-shot resume custody; run closure revokes authority before awaiting cleanup and retains failed cleanup ownership. Existing run/session checks precede resume, tool calls retain the shared dispatch owner, and Gateway shutdown already awaits Code Mode disposal. Inspected tests cover revoked owners, late continuations, cancellation, and cleanup retry. (src/agents/code-mode-state.ts:136, f6e1b0b888ff)
  • Plugin and dependency boundary: QuickJS-WASI remains pinned at 3.6.0 and moves from the root dependency owner to its bundled plugin. The executor resolver preserves explicit denial and disablement, applies full policy to external owners, and rejects unavailable or ambiguous selections without switching to Node. The new SDK contract and its concrete plugin consumer are documented. (src/plugins/code-mode-executor.ts:15, f6e1b0b888ff)
  • Captured proof body inspected completely: The full GitHub body matched captured SHA-256 ef9bcc11a970554a4873b6403ef76c789ec5f140b03459c5a1cdf431f9a7064e. It reports two first-attempt real-model JavaScript trials, installed-package dispatch and resume probes, six installed CLI selection cases including denial, and three published-2026.9.4-updater-to-candidate cases. These observations concern the changed executors and migration owner; subsequent integration checks are separately attributed. (f6e1b0b888ff)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: 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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-21T11:22:36.188Z sha be77c0c :: blocked before merge. :: none
  • reviewed 2026-09-21T16:31:04.675Z sha 82674ab :: blocked before merge. :: none
  • reviewed 2026-09-21T16:54:37.718Z sha 667a9eb :: blocked before merge. :: none
  • reviewed 2026-09-21T18:18:45.362Z sha 667a9eb :: blocked before merge. :: none
  • reviewed 2026-09-21T20:50:00.773Z sha 900c2a6 :: blocked before merge. :: none
  • reviewed 2026-09-21T21:34:54.914Z sha 8801849 :: blocked before merge. :: none
  • reviewed 2026-09-21T22:12:31.269Z sha 8801849 :: blocked before merge. :: none
  • reviewed 2026-09-21T22:20:57.869Z sha 8801849 :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/code-mode-executors branch 2 times, most recently from da2dc82 to 51e48c9 Compare September 21, 2026 10:14
Default enabled Code Mode to trusted Node execution and move QuickJS into a bundled executor plugin. Preserve typed discovery, JavaScript-only execution, tool authorization, continuation ownership, and explicit legacy QuickJS selections. Add a web settings selector and document both security boundaries.
Remove the retired core worker copies and regenerate config documentation for the requested QuickJS plugin. The 21 added plugin paths are standard plugin management fields; core and channel counts stay unchanged.
Keep only the executor and guest protocol exports consumed by the QuickJS plugin, budget that generic contract, and load the public plugin artifact through the existing runtime test boundary.
Use the worker-side task server, keep asynchronous cleanup ownership explicit, and model the real Promise contracts in lifecycle fixtures. Regenerate the requested plugin config surface and budget the exact 35 public executor exports.
@steipete
steipete merged commit 09e0649 into main Sep 22, 2026
223 checks passed
@steipete
steipete deleted the codex/code-mode-executors branch September 22, 2026 00:33
@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 22, 2026
* feat: add selectable Code Mode executors

Default enabled Code Mode to trusted Node execution and move QuickJS into a bundled executor plugin. Preserve typed discovery, JavaScript-only execution, tool authorization, continuation ownership, and explicit legacy QuickJS selections. Add a web settings selector and document both security boundaries.

* refactor: finish Code Mode executor source cutover

Remove the retired core worker copies and regenerate config documentation for the requested QuickJS plugin. The 21 added plugin paths are standard plugin management fields; core and channel counts stay unchanged.

* refactor: narrow the Code Mode plugin contract

Keep only the executor and guest protocol exports consumed by the QuickJS plugin, budget that generic contract, and load the public plugin artifact through the existing runtime test boundary.

* refactor: align Code Mode workers with current runtime boundaries

Use the worker-side task server, keep asynchronous cleanup ownership explicit, and model the real Promise contracts in lifecycle fixtures. Regenerate the requested plugin config surface and budget the exact 35 public executor exports.

* refactor: keep executor implementation types private

* chore: regenerate code mode config baseline

* fix: satisfy Code Mode executor integration contracts

* test: cover QuickJS plugin metadata and exact settings titles

* test: retain QuickJS integration in the agent runtime suite

* test: keep Code Mode validation within lint and type-shard contracts
steipete added a commit that referenced this pull request Sep 22, 2026
## Problem

Full Release Validation run 35742760135 for the 2026.9.6 candidate failed on deterministic checks that reproduce on any release branch cut from current main:

- `CI / checks-node-core-tooling-15`: `test/scripts/tsgo-core-test-shards.test.ts` reported `gateway-server: 701 test roots exceeds the 700 limit` (the candidate was cut before the rebalance in #155734).
- `Plugin Prerelease / checks-node-extensions-shard-*`: `extensions/facetime/tests/package-manifest.test.ts:86` hardcodes the `>=2026.9.4` host contract, so the release-prep version bump to `2026.9.6` fails the test on every release branch.
- `Plugin Prerelease / checks-node-agentic-plugins`: `src/plugins/bundled-plugin-icons.test.ts` ENOENT on `extensions/code-mode-quickjs/assets/icon.png`, and `src/plugins/bundled-plugin-metadata.test.ts:545` found no `activation.onStartup` on the new QuickJS Code Mode manifest (#154522).
- `Plugin Prerelease / plugin-npm-security-scan`: five unreviewed `dangerous-exec` findings (`@openclaw/acpx test/codex-app-server.test.ts:15`, `@openclaw/codex src/app-server/managed-launcher-failure.ts:28`, `@openclaw/codex src/node-exec-server.test.ts:664`, `@openclaw/facetime src/audio-pump.ts:216`, `@openclaw/onnx src/worker-client.ts:162`) plus an `@openclaw/codex` reviewed inventory mismatch after #155612 removed two bounded child launches from `attempt-startup-retry.test.ts`.

## Solution

One commit per fix, no new configuration:

1. Shard cap: already fixed on main by #155734 (worker-environments roots moved to `gateway-other`; gateway-server now holds 481 roots). Verified here, no further change.
2. FaceTime manifest test derives the host contract (`peerDependencies`, `install.minHostVersion`, `compat.pluginApi`, `build.openclawVersion`) from the package version that release preparation bumps in lockstep.
3. QuickJS Code Mode ships the OpenClaw fallback identity tile and the sandbox activity glyph (both byte-for-byte reuse, recorded in `ICON_SOURCES.md` / `ACTIVITY_ICON_SOURCES.md`) and declares `activation.onStartup: false`; the executor is resolved lazily through its `codeModeExecutors` contract.
4. Plugin npm security scan inventory: each new site was read and is a fixed trusted launch with no untrusted interpolation.
   - `@openclaw/facetime src/audio-pump.ts:216`: `spawn(captureBinary, [], { env: sanitized })` where `captureBinary` comes from the plugin's own staged native install (`ensureCaptureBinary`). Required runtime entry.
   - `@openclaw/onnx src/worker-client.ts:162`: `spawn(process.execPath, resolveRuntimeWorkerArgv(workerUrl), { shell: false })` forking the plugin's bundled worker entry. Required runtime entry.
   - `@openclaw/codex src/app-server/managed-launcher-failure.ts:28`: no process launch; the `spawn(` match is inside a regex literal that classifies stderr. Reviewed as a current-only packed entry.
   - `@openclaw/acpx test/codex-app-server.test.ts:15`: `execFileSync(process.execPath, [checked-in fixture], { env: {}, timeout })`. Test-only packed entry.
   - `@openclaw/codex src/node-exec-server.test.ts:664`: inline `-e` script for `process.execPath` inside the exec server's owned workspace fixture. Test-only packed entry.
   - `@openclaw/codex src/app-server/attempt-startup-retry.test.ts`: reviewed count 6 -> 4 for the current inventory only.
   The pre-9.6 required-source inventory is frozen as `RELEASE_2026_9_5_REQUIRED_REVIEWED_SOURCE_FINDING_COUNTS` and pinned to the 9.3/9.4/9.5 contexts, so shipped release rescans do not start requiring files they never had.

## Impact

Unblocks 2026.9.6 validation on the next candidate cut. No runtime behaviour change except the QuickJS plugin now declaring lazy activation, which matches how the executor was already loaded.

## Evidence

- `test/scripts/tsgo-core-test-shards.test.ts`, `extensions/facetime/tests/package-manifest.test.ts`, `src/plugins/bundled-plugin-icons.test.ts`, `src/plugins/bundled-plugin-metadata.test.ts`: pass locally.
- `test/scripts/plugin-npm-security-scan.test.ts`: 44/44 pass.
- Local end-to-end scan (`plugin-npm-security-prepare.mts plan/prepare` + `plugin-npm-security-scan-runner.mjs`) for both the `""` and `release/2026.9.6` contexts: `unexpectedCriticalFindingCount: 0`, no inventory mismatch, layout `current`. The only remaining local errors are the gitignored `extensions/diffs/assets/viewer-runtime.js` build output exceeding the per-file byte limit, which is absent from the unbuilt CI candidate.
- `src/plugins/bundled-plugin-metadata.public-surfaces.test.ts` and `src/plugins/manifest-registry.test.ts` have three pre-existing host-only failures here (synthetic temp-root public-surface loading) unrelated to this change; CI is authoritative.
- FRV run: https://github.com/openclaw/openclaw/actions/runs/35742760135

Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
## Problem

Full Release Validation run 35742760135 for the 2026.9.6 candidate failed on deterministic checks that reproduce on any release branch cut from current main:

- `CI / checks-node-core-tooling-15`: `test/scripts/tsgo-core-test-shards.test.ts` reported `gateway-server: 701 test roots exceeds the 700 limit` (the candidate was cut before the rebalance in openclaw#155734).
- `Plugin Prerelease / checks-node-extensions-shard-*`: `extensions/facetime/tests/package-manifest.test.ts:86` hardcodes the `>=2026.9.4` host contract, so the release-prep version bump to `2026.9.6` fails the test on every release branch.
- `Plugin Prerelease / checks-node-agentic-plugins`: `src/plugins/bundled-plugin-icons.test.ts` ENOENT on `extensions/code-mode-quickjs/assets/icon.png`, and `src/plugins/bundled-plugin-metadata.test.ts:545` found no `activation.onStartup` on the new QuickJS Code Mode manifest (openclaw#154522).
- `Plugin Prerelease / plugin-npm-security-scan`: five unreviewed `dangerous-exec` findings (`@openclaw/acpx test/codex-app-server.test.ts:15`, `@openclaw/codex src/app-server/managed-launcher-failure.ts:28`, `@openclaw/codex src/node-exec-server.test.ts:664`, `@openclaw/facetime src/audio-pump.ts:216`, `@openclaw/onnx src/worker-client.ts:162`) plus an `@openclaw/codex` reviewed inventory mismatch after openclaw#155612 removed two bounded child launches from `attempt-startup-retry.test.ts`.

## Solution

One commit per fix, no new configuration:

1. Shard cap: already fixed on main by openclaw#155734 (worker-environments roots moved to `gateway-other`; gateway-server now holds 481 roots). Verified here, no further change.
2. FaceTime manifest test derives the host contract (`peerDependencies`, `install.minHostVersion`, `compat.pluginApi`, `build.openclawVersion`) from the package version that release preparation bumps in lockstep.
3. QuickJS Code Mode ships the OpenClaw fallback identity tile and the sandbox activity glyph (both byte-for-byte reuse, recorded in `ICON_SOURCES.md` / `ACTIVITY_ICON_SOURCES.md`) and declares `activation.onStartup: false`; the executor is resolved lazily through its `codeModeExecutors` contract.
4. Plugin npm security scan inventory: each new site was read and is a fixed trusted launch with no untrusted interpolation.
   - `@openclaw/facetime src/audio-pump.ts:216`: `spawn(captureBinary, [], { env: sanitized })` where `captureBinary` comes from the plugin's own staged native install (`ensureCaptureBinary`). Required runtime entry.
   - `@openclaw/onnx src/worker-client.ts:162`: `spawn(process.execPath, resolveRuntimeWorkerArgv(workerUrl), { shell: false })` forking the plugin's bundled worker entry. Required runtime entry.
   - `@openclaw/codex src/app-server/managed-launcher-failure.ts:28`: no process launch; the `spawn(` match is inside a regex literal that classifies stderr. Reviewed as a current-only packed entry.
   - `@openclaw/acpx test/codex-app-server.test.ts:15`: `execFileSync(process.execPath, [checked-in fixture], { env: {}, timeout })`. Test-only packed entry.
   - `@openclaw/codex src/node-exec-server.test.ts:664`: inline `-e` script for `process.execPath` inside the exec server's owned workspace fixture. Test-only packed entry.
   - `@openclaw/codex src/app-server/attempt-startup-retry.test.ts`: reviewed count 6 -> 4 for the current inventory only.
   The pre-9.6 required-source inventory is frozen as `RELEASE_2026_9_5_REQUIRED_REVIEWED_SOURCE_FINDING_COUNTS` and pinned to the 9.3/9.4/9.5 contexts, so shipped release rescans do not start requiring files they never had.

## Impact

Unblocks 2026.9.6 validation on the next candidate cut. No runtime behaviour change except the QuickJS plugin now declaring lazy activation, which matches how the executor was already loaded.

## Evidence

- `test/scripts/tsgo-core-test-shards.test.ts`, `extensions/facetime/tests/package-manifest.test.ts`, `src/plugins/bundled-plugin-icons.test.ts`, `src/plugins/bundled-plugin-metadata.test.ts`: pass locally.
- `test/scripts/plugin-npm-security-scan.test.ts`: 44/44 pass.
- Local end-to-end scan (`plugin-npm-security-prepare.mts plan/prepare` + `plugin-npm-security-scan-runner.mjs`) for both the `""` and `release/2026.9.6` contexts: `unexpectedCriticalFindingCount: 0`, no inventory mismatch, layout `current`. The only remaining local errors are the gitignored `extensions/diffs/assets/viewer-runtime.js` build output exceeding the per-file byte limit, which is absent from the unbuilt CI candidate.
- `src/plugins/bundled-plugin-metadata.public-surfaces.test.ts` and `src/plugins/manifest-registry.test.ts` have three pre-existing host-only failures here (synthetic temp-root public-surface loading) unrelated to this change; CI is authoritative.
- FRV run: https://github.com/openclaw/openclaw/actions/runs/35742760135

Co-authored-by: Peter Steinberger <[email protected]>
@VACInc

VACInc commented Sep 28, 2026

Copy link
Copy Markdown
Member

Executor follow-up: #160217 fixes error-origin attribution in the Node and QuickJS execution paths introduced here. The shared controller records original rejected bridge errors, and both executors preserve that origin through exec/wait instead of treating dispatch history as the error's cause. Node error formatting also preserves origin despite guest serialization hooks or throwing error getters. Executor selection, defaults, the Node VM trust boundary, and replay authorization are unchanged.

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

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: codex extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. scripts Repository scripts size: XL 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.

2 participants