π€ AI-assisted (Claude Code). This bug was caught and diagnosed by my AI agent while operating my local OpenClaw deployment, and the linked fix is its proposal. All evidence below is from real logs and the published npm artifacts. (Previous report from this setup: #98261 / PR #98267.)
Related: #78367 (compaction storms β this bug is a plausible contributing cause), #66263 (stale post-compaction context bookkeeping), #95553 (adjacent compaction-timeout area).
Problem
scripts/runtime-postbuild.mjs writes stable aliases for hashed runtime chunks as a bare star re-export:
// dist/embedded-agent-subscribe.handlers.compaction.runtime.js (published 2026.6.10 AND 2026.6.11)
export * from "./embedded-agent-subscribe.handlers.compaction.runtime-<HASH>.js";
But export * from never re-exports default (ES module semantics). Several alias targets export only default, so lazy consumers that destructure it get undefined.
Concrete failure β after every successful auto-compaction:
late compaction count reconcile failed: TypeError: reconcile is not a function
because the selection chunk does:
const { default: reconcile } = await import("./embedded-agent-subscribe.handlers.compaction.runtime.js");
return reconcile(params); // reconcile === undefined
while the target's only export is export { reconcileSessionStoreCompactionCountAfterSuccess as default }.
Impact
reconcileSessionStoreCompactionCountAfterSuccess never persists the compaction count β post-compaction bookkeeping silently fails on every compaction, for every user of the published builds.
- Observed downstream effect on a local-model deployment (llama.cpp, 122B): 3 auto-compactions within 25 minutes on one session, each followed by a full context re-prefill (multi-minute on local hardware) β i.e. a compaction storm presenting as an unresponsive agent. Cloud deployments likely mask this (re-prefills cost seconds).
Affected aliases (verified in the published [email protected] tarball)
CORRECTION (2026-07-04): module-level verification (import() each hashed target, check typeof m.default) shows exactly one alias target actually exports default today: embedded-agent-subscribe.handlers.compaction.runtime.js β the proven-broken reconcile path. The other six stable aliases (agent-runner, cli, devices-cli, models-cli, monitor-webhook, plugins-cli) point at chunks with no default export, so their star-only aliases are currently harmless (the original "7 affected" count came from a naive text scan for as default, which matched string content inside minified bundles β my mistake). The generator defect still applies to all aliases: any target that gains a default export silently loses it. Note for implementers: naive text matching also breaks the OTHER way β appending export {{ default }} to an alias whose target lacks one is a hard SyntaxError at import (we hit this live); detection must be against real export statements.
Note: scripts/stage-bundled-plugin-runtime.mjs emits the same bare export * from pattern for plugin runtimes β not verified, but the same class.
Fix
When the alias target has a default export, also emit export { default } from ... β in both the stable-alias and legacy-compat writers. PR incoming with a regression test that mirrors the real reconcile chunk shape.
Workaround (local, verified)
Append export { default } from "./<HASH-target>.js"; to each affected alias in dist/ β the reconcile error stops immediately. (Lost on every update, hence this report.)
Environment
- openclaw 2026.6.10 and 2026.6.11 (both published tarballs verified affected); generator unchanged on current
main (scripts/runtime-postbuild.mjs lines ~323 and ~513)
- Local models via llama.cpp (where the re-prefill cost makes the loop user-visible)
Related: #78367 (compaction storms β this bug is a plausible contributing cause), #66263 (stale post-compaction context bookkeeping), #95553 (adjacent compaction-timeout area).
Problem
scripts/runtime-postbuild.mjswrites stable aliases for hashed runtime chunks as a bare star re-export:But
export * fromnever re-exportsdefault(ES module semantics). Several alias targets export onlydefault, so lazy consumers that destructure it getundefined.Concrete failure β after every successful auto-compaction:
because the selection chunk does:
while the target's only export is
export { reconcileSessionStoreCompactionCountAfterSuccess as default }.Impact
reconcileSessionStoreCompactionCountAfterSuccessnever persists the compaction count β post-compaction bookkeeping silently fails on every compaction, for every user of the published builds.Affected aliases (verified in the published
[email protected]tarball)CORRECTION (2026-07-04): module-level verification (
import()each hashed target, checktypeof m.default) shows exactly one alias target actually exportsdefaulttoday:embedded-agent-subscribe.handlers.compaction.runtime.jsβ the proven-broken reconcile path. The other six stable aliases (agent-runner,cli,devices-cli,models-cli,monitor-webhook,plugins-cli) point at chunks with no default export, so their star-only aliases are currently harmless (the original "7 affected" count came from a naive text scan foras default, which matched string content inside minified bundles β my mistake). The generator defect still applies to all aliases: any target that gains a default export silently loses it. Note for implementers: naive text matching also breaks the OTHER way β appendingexport {{ default }}to an alias whose target lacks one is a hardSyntaxErrorat import (we hit this live); detection must be against real export statements.Note:
scripts/stage-bundled-plugin-runtime.mjsemits the same bareexport * frompattern for plugin runtimes β not verified, but the same class.Fix
When the alias target has a default export, also emit
export { default } from ...β in both the stable-alias and legacy-compat writers. PR incoming with a regression test that mirrors the real reconcile chunk shape.Workaround (local, verified)
Append
export { default } from "./<HASH-target>.js";to each affected alias indist/β the reconcile error stops immediately. (Lost on every update, hence this report.)Environment
main(scripts/runtime-postbuild.mjslines ~323 and ~513)