Skip to content

fix: allow fetched plugins and Code Mode in AOT builds - #182818

Merged
steipete merged 2 commits into
mainfrom
fix/aot-interpreted-features
Oct 24, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/aot-interpreted-features

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

AOT standalone hosts reject fetched plugins, Node Code Mode, and QA expressions even though these features can run in the interpreter.

User Impact

Fetched CJS and TypeScript plugins can load through the existing loader and share the compiled host SDK. Code Mode cells, retained continuations, and QA expressions/lambdas execute normally. Each interpreted feature emits one performance notice per process, with the same execution facts visible in Doctor diagnostics.

Why This Change Was Made

The previous runtime profile conflated AOT compilation with a ban on runtime code. This removes its rejection branches and keeps the profile as the owner of execution diagnostics. Plugin trust, source capture, cache generations, and tool authority stay with their existing owners.

Actual failures retain actionable guidance: missing runtime modules identify the disk-loader/rebuild options, while a code-generation restriction names the disabling flag. No strict flag, new configuration, or automatic executor switch is introduced.

Evidence

The execution regressions fail on the original profile guards and pass after the cutover. All 107 focused assertions pass with pnpm test <file> --maxWorkers=1:

Test file Passed Wall time
src/infra/runtime-profile.test.ts 8 10.52s
src/infra/runtime-capabilities.test.ts 3 17.61s
src/plugins/plugin-module-loader-cache.runtime-profile.test.ts 2 3.82s
src/agents/code-mode-executor.runtime-profile.test.ts 3 200.08s
extensions/qa-lab/src/scenario-flow-runner.runtime-profile.test.ts 5 15.83s
src/plugins/plugin-module-loader-cache.test.ts 12 231.77s
src/agents/code-mode-executor.test.ts 4 6.75s
extensions/qa-lab/src/scenario-flow-runner.test.ts 19 310.79s
test/scripts/bun-standalone-metadata.test.ts 51 27.96s

The longer runs include cold compiled-worker preparation; the new Code Mode test body takes 2.06s. Its collection preload keeps that fixture work outside the unchanged cell execution budget. Targeted core/QA lint, source/test types, formatting, and documentation link/glossary checks pass.

Small probes use the experimental Bun AOT toolchain (5d8fe974f); no whole-application AOT build was run. The final six-module probe uses the production loader's bounded static closure and the standalone native/import/require adapters in the real two-stage order. With no supplied factory, fetched CJS and TypeScript/Jiti each return 42 and preserve compiled SDK object/class identity while the SDK source, staged Jiti CJS sources, and entire emitted module directory are hidden. Compilation took 4.592s. A separate repeated-load probe returns 42 then 44 from the same SDK object and emits one notice. Earlier raw-source fixture attempts lacked the builder's transformation order and CJS classification; those failures are not claimed as product defects.

The actual profile-owner probe returns 42 from VM and Function code, preserves actionable missing-import guidance, and emits exactly one notice per feature across the parent and a compiled worker. Its nine-module compile took 2.510s. Strict VM/Function/Jiti controls fail with code-generation guidance. The interpreter tripwire was not used as proof. These are execution/SDK boundary probes, not qualification of arbitrary native ESM, workers, child programs, or plugin dependencies.

CI initially found that the warning identifier used the environment-variable namespace. The diagnostic is now AOT_INTERPRETED; the unchanged environment-variable budget passes at 457/457. The eight runtime-profile tests, focused lint, and formatting pass after this correction. The initial CI run also hit a Telegram polling timing failure in unchanged code; the exact case passes locally without a source or timeout change (175.65s including cold worker preparation). The identical assertion reproduces on current main e1e498602cec224ef4adb16f13512ca6aea26d98 with the same missing status/stop events (118.55s Vitest duration including cold worker preparation). The polling test and implementation are unchanged by this PR. These observations establish an inherited timing failure; the passing PR replay is not claimed as a fix.

The final independent Codex review through P2 is scoped-clean, including source-integrity verification. The owner retains diagnostics and removes the obsolete admission policy; no second SDK, loader, or authority owner is introduced.

Follow-up to #182346. Full artifact qualification remains with the standalone build lane.

Current-head CI run 40126830978 completed all 86 jobs. The only failed test job is the identical Telegram polling assertion reproduced on main; its aggregate CI gate is red. The ratchet, security check, and all other jobs passed or were skipped. This PR uses the native pre-existing-failure landing route and does not claim green CI.

Allow fetched CJS and TypeScript plugins, Node Code Mode and QA evaluation through their existing owners. Report interpreted execution once per process and feature, and add guidance only after genuine runtime failures. Keep Doctor diagnostics tied to the selected execution profile.
@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 19:28
@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-24T19:31:01.629359Z 8accbe7 Draft marked ready
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: qa-lab plugin: file-transfer size: M labels Oct 24, 2026
@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. labels Oct 24, 2026
@steipete
steipete merged commit 2f828ee into main Oct 24, 2026
150 of 154 checks passed
@steipete
steipete deleted the fix/aot-interpreted-features branch October 24, 2026 20:04
@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(runtime): allow interpreted features in AOT builds

Allow fetched CJS and TypeScript plugins, Node Code Mode and QA evaluation through their existing owners. Report interpreted execution once per process and feature, and add guidance only after genuine runtime failures. Keep Doctor diagnostics tied to the selected execution profile.

* fix(runtime): keep AOT notice outside env namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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. docs Improvements or additions to documentation extensions: qa-lab plugin: file-transfer size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant