Skip to content

fix: keep text transform runtime imports hashed - #95081

Merged
openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
849261680:fix/95057-text-transforms-runtime
Jun 22, 2026
Merged

openclaw-clownfish[bot] merged 1 commit into
openclaw:mainfrom
849261680:fix/95057-text-transforms-runtime

Conversation

@849261680

@849261680 849261680 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a released-package gateway crash-loop path where new chunks can import expanded text-transform exports through a stable alias that an already-running gateway may have cached from an older package.
  • Keeps new text-transforms.runtime imports on the hashed runtime chunk while still generating the stable wrapper for old chunks.
  • Adds legacy compat wrappers for the shipped v2026.5.22 and v2026.6.8 text-transform runtime hashes.
  • Out of scope: changing provider runtime behavior or plugin text-transform semantics.

Linked context

Closes #95057

Related #95057

Was this requested by a maintainer or owner?

  • Requested in maintainer workflow to repair the P1 release regression.

Real behavior proof (required for external PRs)

  • Behavior addressed: macOS LaunchAgent-managed gateway can crash-loop after upgrading when new provider/CLI chunks import n/i/a/r/t from ./text-transforms.runtime.js but the live process has an older stable wrapper cached that only exposed t.
  • Real environment tested: local source checkout on macOS with Node 22 toolchain and npm package inspection of published openclaw@2026.5.22 and openclaw@2026.6.8.
  • Exact steps or command run after this patch: node scripts/runtime-postbuild.mjs after a source build had produced dist; then inspected generated importers with rg -n "text-transforms\.runtime\.js|text-transforms\.runtime-[A-Za-z0-9_-]+\.js" dist/provider-runtime*.js dist/cli-backends*.js dist/prepare.runtime*.js dist/execute.runtime*.js dist/selection*.js dist/compact*.js and inspected dist/text-transforms.runtime-D9-SpAmI.js plus dist/text-transforms.runtime-sEqsN4pN.js.
  • Evidence after fix:
--- runtime-postbuild stderr ---
runtime-postbuild: stable root runtime imports completed in 5858ms
runtime-postbuild: stable root runtime aliases completed in 572ms
runtime-postbuild: legacy root runtime compat aliases completed in 1ms
--- importers ---
dist/cli-backends-uScbGHoe.js:4:import { r as mergePluginTextTransforms, t as resolveRuntimeTextTransforms } from "./text-transforms.runtime-DhZfO7FJ.js";
dist/provider-runtime-Cqktwbuy.js:10:import { n as applyPluginTextReplacements, r as mergePluginTextTransforms, t as resolveRuntimeTextTransforms } from "./text-transforms.runtime-DhZfO7FJ.js";
dist/compact-pRQItHot.js:12:import { i as wrapStreamFnTextTransforms } from "./text-transforms.runtime-DhZfO7FJ.js";
dist/execute.runtime-DCIHvX5t.js:5:import { n as applyPluginTextReplacements } from "./text-transforms.runtime-DhZfO7FJ.js";
dist/prepare.runtime-Db3n21Sv.js:11:import { n as applyPluginTextReplacements } from "./text-transforms.runtime-DhZfO7FJ.js";
dist/selection-DS_psmoB.js:34:import { a as createStreamIteratorWrapper, i as wrapStreamFnTextTransforms } from "./text-transforms.runtime-DhZfO7FJ.js";
--- compat ---
export * from "./text-transforms.runtime.js";
export * from "./text-transforms.runtime.js";
  • Observed result after fix: new chunks no longer depend on the stable text-transforms.runtime.js module namespace for expanded exports, while old shipped hashed runtime names still resolve through compat wrappers.
  • What was not tested: a full macOS Apple Silicon LaunchAgent upgrade from openclaw@2026.5.22 to this unpublished branch package.
  • Proof limitations or environment constraints: pnpm build completed tsdown and runtime-postbuild but timed out at 15 minutes during the later plugin SDK d.ts stage, so the package-level proof is based on the completed generated dist runtime-postbuild output plus focused tests rather than a full build command exit 0.
  • Before evidence:
2026.5.22 dist/text-transforms.runtime.js:
export * from "./text-transforms.runtime-D9-SpAmI.js";

2026.5.22 dist/text-transforms.runtime-D9-SpAmI.js export surface:
export { resolveRuntimeTextTransforms as t };

2026.6.8 importer examples:
dist/provider-runtime-Cp9BfFXg.js imports n/r/t from "./text-transforms.runtime.js"
dist/cli-backends-f9hsjoJk.js imports r/t from "./text-transforms.runtime.js"
dist/selection-kQiC501t.js imports a/i from "./text-transforms.runtime.js"

Tests and validation

Which commands did you run?

  • pnpm install --frozen-lockfile
  • node scripts/run-vitest.mjs test/scripts/runtime-postbuild.test.ts
  • pnpm exec oxfmt --check --threads=1 scripts/runtime-postbuild.mjs test/scripts/runtime-postbuild.test.ts
  • node scripts/runtime-postbuild.mjs
  • .agents/skills/autoreview/scripts/autoreview --mode local
  • git diff --check

What regression coverage was added or updated?

  • Added runtime-postbuild tests proving text-transform runtime importers stay hashed after the stable alias export surface expansion.
  • Added runtime-postbuild tests proving previous published text-transform runtime hash names get compat wrappers.

What failed before this fix, if known?

  • The package comparison shows the old stable wrapper exposed only t, while the new released chunks import more aliases through the same stable module path. That can fail in a live process with a cached older wrapper namespace.

If no test was added, why not?

  • Tests were added.

Risk checklist

Did user-visible behavior change? (Yes/No)

  • Yes. It changes generated package runtime import paths to avoid upgrade-time gateway crashes.

Did config, environment, or migration behavior change? (Yes/No)

  • No.

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

  • No.

What is the highest-risk area?

  • Runtime package postbuild aliasing for live upgrades.

How is that risk mitigated?

  • The change is scoped to one runtime alias skip and two shipped hash compat entries, with focused fixture tests and generated dist proof that old compat wrappers and new hashed importers coexist.

Current review state

What is the next action?

  • Waiting for CI and ClawSweeper review.

What is still waiting on author, maintainer, CI, or external proof?

  • Maintainer/CI may still choose to run full package acceptance or a macOS LaunchAgent package-upgrade proof.

Which bot or reviewer comments were addressed?

  • Real behavior proof body was updated with copied postbuild output after the initial gate did not recognize the evidence line as copied live output.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 5:44 PM ET / 21:44 UTC.

Summary
The PR updates scripts/runtime-postbuild.mjs to keep new text-transforms.runtime.js imports on hashed chunks, adds two shipped text-transform compat wrapper names, and adds focused runtime-postbuild tests.

PR surface: Tests +54, Other +9. Total +63 across 2 files.

Reproducibility: Do we have a high-confidence way to reproduce the issue? Partly: package tarball inspection reproduces the import/export mismatch, but this review did not run the full macOS LaunchAgent upgrade crash path.

Review metrics: 1 noteworthy metric.

  • Runtime Alias Compatibility Surface: 2 legacy aliases added, 1 stable-import alias skipped. This is the merge-critical behavior: old shipped text-transform chunk names remain resolvable while new chunks avoid the cached stable wrapper namespace.

Stored data model
Persistent data-model change detected: serialized state: test/scripts/runtime-postbuild.test.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #95057
Summary: This PR is the candidate fix for the open released-package gateway crash-loop caused by the text-transform runtime stable alias/export mismatch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Run a package or macOS LaunchAgent upgrade smoke if maintainers require end-to-end proof beyond generated-dist inspection.

Risk before merge

  • [P1] The full macOS LaunchAgent upgrade from an affected shipped package to the PR package was not run, so the process-cache behavior is proven by package/generated-dist inspection rather than end-to-end smoke.
  • [P1] The diff changes generated package runtime aliasing; an incorrect skip or compat target can surface as gateway startup failure or live-upgrade crash-loop behavior.

Maintainer options:

  1. Run A Packaged Upgrade Smoke (recommended)
    Prove an upgrade from an affected shipped package to the PR build and confirm new chunks do not depend on a cached stable text-transform wrapper.
  2. Accept The Focused Generator Proof
    Maintainers can intentionally land with the PR body's postbuild output, tarball inspection, focused tests, and green CI if release urgency outweighs missing LaunchAgent smoke.

Next step before merge

  • No automated repair is indicated; maintainers need to decide whether the supplied generated-dist proof is enough or require an end-to-end package upgrade smoke before merge.

Security
Cleared: No concrete security or supply-chain concern found; the diff touches an existing postbuild script and tests without changing dependencies, workflows, permissions, secrets, or downloads.

Review details

Best possible solution:

Land the narrow generator fix after CI plus either a package-upgrade smoke or an explicit maintainer decision to accept the focused generated-dist proof for this release regression.

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

Do we have a high-confidence way to reproduce the issue? Partly: package tarball inspection reproduces the import/export mismatch, but this review did not run the full macOS LaunchAgent upgrade crash path.

Is this the best way to solve the issue?

Is this the best way to solve the issue? Yes: skipping only text-transforms.runtime.js import rewrites is narrower than disabling stable aliasing globally, while compat wrappers preserve the old shipped hash names.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 108d6d7eca00.

Label changes

Label justifications:

  • P1: The PR targets a released gateway crash-loop that can prevent LaunchAgent-managed gateways from staying up after upgrade.
  • merge-risk: 🚨 compatibility: The patch changes generated package runtime aliasing and live-upgrade compatibility behavior for shipped runtime chunks.
  • merge-risk: 🚨 availability: A wrong postbuild alias decision can surface as gateway startup failure or repeated crash-loop behavior during upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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): Sufficient live-output proof: the PR body includes exact postbuild commands and generated-dist observations showing hashed importers and compat wrappers after the fix, though not a full LaunchAgent upgrade smoke.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live-output proof: the PR body includes exact postbuild commands and generated-dist observations showing hashed importers and compat wrappers after the fix, though not a full LaunchAgent upgrade smoke.
Evidence reviewed

PR surface:

Tests +54, Other +9. Total +63 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 54 0 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 9 0 +9
Total 2 63 0 +63

What I checked:

Likely related people:

  • vincentkoc: Recent history ties this person to scripts/runtime-postbuild.mjs, the runtime-postbuild tests, and the latest release commit touching the same package/runtime surface. (role: recent area contributor and release-history owner; confidence: high; commits: c645ec4555c0, ebb670b20863; files: scripts/runtime-postbuild.mjs, test/scripts/runtime-postbuild.test.ts, src/plugins/text-transforms.runtime.ts)
  • steipete: History shows this person introduced plugin text transforms across provider runtime, CLI backends, and the text-transform runtime bridge. (role: introduced behavior and adjacent runtime owner; confidence: high; commits: 202f80792ed1; files: src/agents/plugin-text-transforms.ts, src/plugins/text-transforms.runtime.ts, src/plugins/provider-runtime.ts)
  • gumadeiras: History shows earlier runtime-postbuild and bundled runtime staging work in the same generated package artifact area. (role: adjacent runtime-postbuild contributor; confidence: medium; commits: 4fb01603090c, 09df232f3937, 2dab0c518a6e; files: scripts/runtime-postbuild.mjs, test/scripts/runtime-postbuild.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 19, 2026
@openclaw-clownfish
openclaw-clownfish Bot merged commit c51933d into openclaw:main Jun 22, 2026
224 of 240 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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.

[macOS Apple Silicon] Gateway crash-loops on 2026.6.8: SyntaxError text-transforms.runtime.js

1 participant