Skip to content

fix: restore standalone helper launches - #182982

Merged
steipete merged 2 commits into
mainfrom
fix/aot-runtime-process-entries
Oct 25, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/aot-runtime-process-entries

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Standalone update, MCP, and file-transfer helpers could launch JavaScript paths or inline programs that were unavailable after packaging.

User Impact

Packaged helpers use declared entries and the existing worker/child dispatcher. Source Node/Bun launches keep their package roots, runtime flags, and lifecycle behavior. No configuration change or new dependency is required.

Why This Change Was Made

The runtime-process manifest now owns the remaining helper entries and copied programs. Explicit modules replace inline native-gate, cleanup, and file-transfer programs. Dependency entries resolve relative to their calling package; path resolution does not impose an execution policy.

The update canary distinguishes CLI launches from worker dispatch. Retained generations preserve embedded executable identity, and native-gate bytes are staged even when complete rollback retention is unavailable. Existing admission, cancellation, environment, and cleanup protections remain at their owners.

This completes the runtime cutover following #182405. It removes inline helper programs and repeated caller-owned paths; added code consists of explicit entry modules, manifest projections, and regressions for their distinct launch/lifecycle boundaries. Build-time source enforcement follows separately.

Evidence

Targeted source, script, and tooling typechecks; production, script, and test lint; formatting; and line-count checks pass. Native declaration preparation for the five touched package-boundary plugins passes (697.54s). Full package/platform checks remain with PR CI.

  • Entry resolution and canary routing: 32 tests pass under Bun, 158.50s wall.
  • Runtime asset/build suites: pass, 119.82s. Generated-source check passes in 0.89s.
  • Native PR wrapper inventory: passes, 110.03s.
  • Admission: all 25 tests pass under Node, 202.97s; focused Bun case passes, 414.82s. A fixture now creates its tracked directory through the secure-temp owner so an external scratch volume does not invalidate the test before admission runs.
  • The unchanged native-gate/cleanup and retained-generation sources retain their Node/Bun boundary proof: 34/34 (Node 26.31s, Bun 16.81s) and 52/52 (Node 32.85s, Bun 29.31s), respectively. Source hashes were compared when assembling this candidate.
  • Independent Codex review completed with no actionable P0–P2 findings.

Small probes compiled with Bun revision 5d8fe974f reproduce missing-entry and wrong-dispatch failures, then pass with declared entries and source directories hidden. They cover file-transfer, native-gate/cleanup, retained embedded generation identity, MCP selection, and copied secret-provider programs with synthetic inputs. Loose Node/Bun comparisons pass too. These are entry-routing proofs; no whole-application or database qualification is claimed, and no interpreter tripwire is used.

CI Repairs and Local Limits

CI exposed native Node source imports that referenced emitted .js paths, and a Doctor capability check that treated argv[1] as a worker path after Bun added --no-install. Source tooling now imports the actual TypeScript modules; Doctor receives an explicit worker URL separately from argv. Update fixtures recognize declared worker and retained-script entries while preserving lifecycle assertions.

  • The four npm/source-import suites pass in 56.99s wall; the build-cache suite passes all 54 tests in 235.89s.
  • Nine selected update/platform regression cases pass, 55 unrelated cases skipped, in 806.92s wall. This includes 190.97s cold compiler preparation and real Doctor/SQLite custody. The pre-fix post-core replay had three failures and one passing control.
  • All ten Doctor capability cases pass under Node and Bun, including malformed contracts and revoked authority. Targeted types, source/test lint, formatting, whitespace, and line-count checks pass. Fresh Codex review reports no actionable P0–P2 findings.
  • Two memory packaging tests fail because their synthetic install lacks @openclaw/fs-safe; both reproduce on main dd155be2, with unchanged relevant inputs through 6c33f5ff.
  • A broader local Node admission run was stopped after 12 passing cases and four earlier-refusal failures. All four failures were independently reproduced on main 6c33f5ff (251.04s for the first case; 140.92s for the other three). No complete Node CLI-admission-suite pass is claimed.
  • The local Bun fresh-runtime admission case also fails on unmodified main 6c33f5ff (144.71s). An observation-only replay shows its provisioning spy stops before the native-gate call because no admission context was observed. Original CI reached a later point (admission was recorded); that distinction remains explicit. The temporary observer was removed byte-for-byte, and fresh-head CI must qualify the normal CI path.

Current-Head CI

CI run 40142694288 completed at the current head. Its only failing root job contains the two Docker-selected memory packaging cases above; the aggregate gate fails because of that job. Both cases reproduce on main, and their determining sources, package manifest, lockfile, and test block are unchanged through the actual CI base and tested merge. The same-named scheduled main job ran different test partitions, explaining the informational new classification. Landing uses the native inherited-failure route and preserves these failures; no CI rerun was requested.

@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@steipete
steipete marked this pull request as ready for review October 24, 2026 22:37
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: matrix Channel integration: matrix app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: acpx plugin: file-transfer plugin: mxc extensions: browser extensions: autoreview AutoReview plugin and integration labels Oct 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T23:27:58.475887Z c262347 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

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

These security sensitive changes were made:

  • src/secrets/provider-integrations.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR moves remaining helper programs and launch paths into the shared runtime-process manifest.

Example: A standalone installation lists a paired node's directory.

  • Before: The directory helper runs an inline JavaScript program that standalone packaging cannot reliably dispatch.
  • After: The helper launches the declared fileTransferDirList entry through the existing dispatcher.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-directed repair, with three confirmed integration defects and stable-upgrade compatibility still unqualified.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the ordinary contributor-proof gate; its compiled-probe descriptions qualify entry routing rather than the full updater lifecycle.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Standalone installations cannot reliably launch helpers whose programs or JavaScript paths were omitted during packaging.
Reason: The maintainer-authored direction repairs existing capabilities through their shared owner without adding configuration or dependencies.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: this maintainer-directed repair addresses missing standalone helper entries, but introduces native-tooling import failures and a Bun Doctor capability-check regression.

Priority: P2
Reviewed head: f3d771d508dd4e0c444ab25640bde94389322155

Before merge

  • Preserve native Node imports in the npm tooling closure (P2) - scripts/npm-runner.mts imports npm-command.ts directly in native Node tooling. These new .js specifiers refer to source files that exist only as .ts, so module loading now throws ERR_MODULE_NOT_FOUND before npm resolution or package validation can run. Exact-head contract CI fails on runtime-process-dependency-url.js. Keep this entire shared import closure native-Node-resolvable, including the resolver's manifest import.
  • Keep the worker bundle metadata import usable by native build tooling (P2) - tsdown.config.ts and worker-deploy build helpers import worker-bundle-hash.ts without a TypeScript resolver. The added runtime-process-manifest.js import has no source-tree file, so loading the build configuration fails before compilation starts. Exact-head build-all CI reports this failure while reading configuration entries. Use the existing native source-import convention and preserve emitted-build resolution.
  • Pass the Doctor worker path independently of runtime flags (P1) - Under Bun, resolveRuntimeWorkerArgv produces ['--no-install', workerPath], but inspectUpdateDoctorChildSupport still takes argv[1] as the worker path. It stats '--no-install', interprets ENOENT as a pre-worker installation, and runs legacy Doctor without checking the installed worker's advertised protocol. Modern targets lose delegated Doctor execution, and malformed or unsupported protocols avoid their intended refusal. Exact-head Doctor capability tests show both outcomes. Pass the resolved worker URL/path separately and retain runtime flags only in the launch arguments.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.
  • Explain or restore the original intent of Runtime manifest and native tooling - 5c34fc6: Keep pure process metadata separate from executable declarations while retaining explicit source extensions for native build tooling.

Findings

  • [P2] Preserve native Node imports in the npm tooling closure — src/infra/npm-command.ts:3-4
  • [P2] Keep the worker bundle metadata import usable by native build tooling — src/shared/worker-bundle-hash.ts:2
  • [P1] Pass the Doctor worker path independently of runtime flags — src/cli/update-cli/update-command-fresh-doctor.ts:196-204

Provenance

  • Runtime manifest and native tooling changes intended behavior without addressing why it exists (5c34fc6: Keep pure process metadata separate from executable declarations while retaining explicit source extensions for native build tooling.)

Tests

  • Low-value test test/scripts/code-mode-matrix-gateway-process-owner.test.ts: The added ownership-only case checks fixture-file existence after deleting an unrelated empty directory; the prepared and overlay cases already exercise actual command execution and retirement through the same driver.
  • Missing end-to-end proof: The supplied routing probes do not demonstrate a fresh standalone installation and an upgrade from v2026.10.7 with existing settings and state preserved.
Agent review details

How this fits together

Runtime-process declarations connect helper callers to source modules, installed package outputs, and embedded standalone entries; lifecycle and admission owners still control execution.

flowchart LR
  A[Helper callers] --> B[Runtime process manifest]
  B --> C[Entry resolution]
  C --> D[Source or installed runtime]
  C --> E[Standalone dispatcher]
  D --> F[Helper program]
  E --> F
  F --> G[Result and lifecycle cleanup]
Loading

Technical review

Best possible solution:

Keep the manifest cutover, preserve native Node importability throughout shared tooling closures, and pass the Doctor worker target separately from runtime flags.

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

Current-main source retains the unsupported inline helpers, and exact-head CI independently demonstrates the introduced native-import and Bun capability-check failures; no target code was executed during this review.

Is this the best way to solve the issue?

Extending the existing manifest is appropriate, but its consumers must retain their native source-import and explicit worker-target contracts.

Full review comments:

  • [P2] Preserve native Node imports in the npm tooling closure — src/infra/npm-command.ts:3-4
    scripts/npm-runner.mts imports npm-command.ts directly in native Node tooling. These new .js specifiers refer to source files that exist only as .ts, so module loading now throws ERR_MODULE_NOT_FOUND before npm resolution or package validation can run. Exact-head contract CI fails on runtime-process-dependency-url.js. Keep this entire shared import closure native-Node-resolvable, including the resolver's manifest import.
    Confidence: 1
  • [P2] Keep the worker bundle metadata import usable by native build tooling — src/shared/worker-bundle-hash.ts:2
    tsdown.config.ts and worker-deploy build helpers import worker-bundle-hash.ts without a TypeScript resolver. The added runtime-process-manifest.js import has no source-tree file, so loading the build configuration fails before compilation starts. Exact-head build-all CI reports this failure while reading configuration entries. Use the existing native source-import convention and preserve emitted-build resolution.
    Confidence: 1
  • [P1] Pass the Doctor worker path independently of runtime flags — src/cli/update-cli/update-command-fresh-doctor.ts:196-204
    Under Bun, resolveRuntimeWorkerArgv produces ['--no-install', workerPath], but inspectUpdateDoctorChildSupport still takes argv[1] as the worker path. It stats '--no-install', interprets ENOENT as a pre-worker installation, and runs legacy Doctor without checking the installed worker's advertised protocol. Modern targets lose delegated Doctor execution, and malformed or unsupported protocols avoid their intended refusal. Exact-head Doctor capability tests show both outcomes. Pass the resolved worker URL/path separately and retain runtime flags only in the launch arguments.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Native update admission gate keeps the original intent (fix(update): prevent private Node installation after authority is lost #154334: Hold native installers behind private input until requester and installation ownership are rechecked, keeping NODE_OPTIONS behind admission.)
  • Standalone npm execution keeps the original intent (fix(plugins): restore on-demand installs in standalone builds #174133: Run the packaged npm sidecar while preserving npm's registry, integrity, and lifecycle-script contracts.)
  • Source workspace worker loaders keeps the original intent (53393f7: Register the checkout's TypeScript configuration when source workers run from an external workspace.)
  • Loose plugin secret resolver trust keeps the original intent (25dde25: Match plugin discovery's ownership and permission policy, allowing group-writable files while rejecting world-writable files.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/cli/update-cli/update-command-doctor-capability.test.ts
  • pnpm test src/infra/npm-command.test.ts test/scripts/npm-runner.test.ts test/scripts/check-openclaw-package-tarball.bundled-mcp.test.ts
  • pnpm test test/scripts/build-all.test.ts
  • pnpm test src/infra/runtime-process-package-url.test.ts src/infra/runtime-process-dependency-url.test.ts src/infra/runtime-worker-url.test.ts
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5c34fc6 adds src/infra/runtime-process-manifest.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5c34fc675770; files: src/infra/runtime-process-manifest.ts)
  • Dallin Romney: Raw commit 53393f7 adds src/agents/workspace-worker.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 53393f7d8668; files: src/agents/workspace-worker.ts)
  • Kimi Yu: Raw commit 20db76a adds src/agents/workspace-worker.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 20db76a79212; files: src/agents/workspace-worker.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

  • add P2: The repair has clear value for standalone helper workflows, with a bounded set of identified integration defects.
  • add merge-risk: 🚨 compatibility: The PR expands public SDK exports and changes updater launch arguments; Bun currently selects the wrong Doctor contract.
  • add merge-risk: 🚨 automation: New imports break native Node package validation and build-configuration loading, as confirmed by exact-head CI.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The repair has clear value for standalone helper workflows, with a bounded set of identified integration defects.
  • merge-risk: 🚨 compatibility: The PR expands public SDK exports and changes updater launch arguments; Bun currently selects the wrong Doctor contract.
  • merge-risk: 🚨 automation: New imports break native Node package validation and build-configuration loading, as confirmed by exact-head CI.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 6:55 PM ET / 22:55 UTC.

Use native-resolvable source imports for manifest consumers loaded directly by Node.
Carry the Doctor worker URL separately from argv so runtime flags cannot select
legacy capability handling. Keep update fixtures aligned with declared helper
entries and runtime flags while preserving their lifecycle assertions.
@steipete
steipete merged commit 57f6d20 into main Oct 25, 2026
212 of 217 checks passed
@steipete
steipete deleted the fix/aot-runtime-process-entries branch October 25, 2026 00:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* fix: restore standalone helper launches

* fix: preserve helper launch contracts

Use native-resolvable source imports for manifest consumers loaded directly by Node.
Carry the Doctor worker URL separately from argv so runtime flags cannot select
legacy capability handling. Keep update fixtures aligned with declared helper
entries and runtime flags while preserving their lifecycle assertions.
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 channel: matrix Channel integration: matrix cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: acpx extensions: autoreview AutoReview plugin and integration extensions: browser extensions: memory-core Extension: memory-core gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer plugin: mxc rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant