Skip to content

fix: keep widget shortcuts working in AOT standalone builds - #184134

Merged
steipete merged 2 commits into
mainfrom
fix/fx2-worker-script-assets
Oct 26, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/fx2-worker-script-assets

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: command-palette shortcuts stop working inside embedded widgets when an AOT standalone build omits function source.

User Impact

Widget shortcuts remain available in builds where Function.toString() returns an opaque native body. Keyboard matching, widget isolation, and configuration stay the same.

Why This Change Was Made

The sandbox generated its browser shortcut matcher by serializing a host function. An opaque [native code] body produces invalid JavaScript in the widget frame. The existing runtime-script asset generator now bundles the canonical typed matcher at build time, and the sandbox embeds that asset. Its normal content version changes with the generated bytes.

Related: #183120, #183611.

Evidence

The new regression fetches the real sandbox HTTP response, delivers widget content through its message handler, and parses the resulting inner-frame scripts with opaque host function source. It fails on the original owner with the expected syntax error and passes with this change. The existing Unicode and prototype-isolation test now exercises the generated matcher; asset freshness and dependency-store determinism remain covered.

Focused tests passed across six files (53 tests), including repository/project preparation and opaque-source worker scripts. Targeted production and test typechecking, lint, formatting, and independent review cover the final patch. The final four-test HTTP file passed again after its descriptor-based fixture correction (26.9 s command wall time; test bodies under 1 s). Matcher and asset-generation test bodies took 2 ms and 340 ms respectively; CI timing is pending.

Small emitted-JS JIT and AOT (functionSource: false) executables using the real owners clone and capture a synthetic Git repository, run project inspection, and emit valid widget scripts. The original sandbox AOT control emits an invalid native function body; JIT passes. The worker controls also confirm the already-landed #183611 repair. These are macOS arm64 owner probes; no full application build or Linux AOT qualification is claimed.

The scoped production unused-export scan found the string-named matcher build input missing from Knip's generator roots; this PR now declares it beside the existing script factory inputs. That scan also reported four untouched exports (buildCustomS3PublicUrl, cronSourceScheduleKey, deepFreezeDiagnosticValue, OnboardingRecommendationMatchesSchema). Those findings remain recorded; the local scan is not claimed clean, and exact-head CI is required.

Initial CI also caught the new generated import missing from the trusted PR wrapper's extraction inventory. The asset is now declared there, and both exact failed closure tests pass locally (14.84 s command wall time). The two declaration corrections received a fresh independent review and targeted lint/type/format checks; the runtime implementation and earlier behavior proof are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 26, 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 26, 2026 03:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T03:06:26.014289Z 4fc12cc 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 gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling size: S labels Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 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: a35294c77f1041defbdb8cbd0f022f00a422ec23
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sandbox-host.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

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. labels Oct 26, 2026
@steipete
steipete merged commit b0f3217 into main Oct 26, 2026
136 of 137 checks passed
@steipete
steipete deleted the fix/fx2-worker-script-assets branch October 26, 2026 03:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…#184134)

* fix: keep widget shortcuts working in AOT standalone builds

* fix(build): declare widget shortcut asset consumers
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. docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts security-sensitive-changed size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant