Skip to content

fix(agents): scope fall-through plugin registry loads to the active runtime registry - #130167

Merged
steipete merged 1 commit into
mainfrom
claude/adoring-tesla-d45d0b
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/adoring-tesla-d45d0b

Conversation

@steipete

Copy link
Copy Markdown
Contributor

fix(agents): scope fall-through plugin registry loads to the active runtime registry

What Problem This Solves

First hook/cron isolated-run dispatch in a gateway process blocks the Node event loop for 30-45s, making the gateway HTTP server completely unresponsive (hook POSTs time out past gog's 10s client deadline; the fan-out handler's own 8s response-deadline timer cannot fire). During the gmail hook fan-out live test (PR #130002 follow-up), a 13-message burst pushed every embedded run's attempt-workspace stage to 14-15.4s with all stages ending at the same wall-clock instant — classic event-loop starvation.

Root cause (proven by CPU profile of a live dev-gateway repro): prepareCronRunContext (src/cron/isolated-agent/run-prepare.ts:641) builds its plugin registry via loadAgentRuntimePluginRegistryHandle with only run selections. In resolveAgentRuntimePluginRegistryLoad, the startup-scope fallback chain (explicit base → request-scope registry → snapshot pluginIds) resolves empty on the hook/cron path, and with no base the loader drops onlyPluginIds entirely — cold-loading every discovered plugin (~70 bundled providers). In a dev checkout each uninstalled provider plugin loads from TypeScript source through jiti's synchronous babel transform: one contiguous 42.6s block, of which 36.2s is extension module loading (amazon-bedrock 16.8s, opencode 13.1s), plus ~4s GC from AST churn. The gateway process already owns an active startup plugin registry; the fall-through simply never consulted it. PR #125596 fixed this class for the channel path (which carries its admitted plugin generation); hooks/cron never got the same treatment.

Why This Change Was Made

Owner-level repair: the "what to load" policy lives in resolveAgentRuntimePluginRegistryLoad, and every fall-through caller (hook dispatch, cron scheduler, trigger scripts, subagent registry) benefits from fixing it there. The fallback chain gains one step: when no explicit base, request scope, or snapshot scope exists, use the active process registry's runtime plugin ids as the startup base. resolveAgentRuntimePluginLoadPlan then adds the run's selected provider/harness/memory/context-engine owners on top, preserving the invariant that every selected provider joins the immutable run generation. Hosts with no active registry (pure library use) keep full discovery unchanged.

User Impact

Evidence

BEFORE (cold 13-message POST to /hooks/gmail, dev gateway, fresh process):

  • Hook POST timed out at 30s (client abort); the 8s deadline timer never fired.
  • Independent HTTP probe: gateway unresponsive 06:12:26 → 06:12:57 (~31.5s, two 15s client timeouts + one 11.6s response).
  • CDP CPU profile: single 42.6s non-idle block starting the moment the POST arrived; 36.2s attributed to extension module loading under prepareCronRunContext → loadAgentRuntimePluginRegistryHandle → loadOpenClawPlugins, dominated by jiti/babel TS transpile (18.3s babel.cjs + 5.5s jiti.cjs self time) and jiti cache fs (2.5s readFileUtf8, 2.1s writeFileUtf8).

AFTER (same rig, fresh state dir + fresh process, fix applied):

  • Cold 13-message POST answered in 8.03s with the designed 503 partial fan-out response ("8/13 dispatched, 0 failed, 5 pending" — the 8s response deadline fired; pending items dispatch in background and redelivery replays converge).
  • HTTP probe (500ms cadence, 60s): max latency 4.56s (single cold spike at burst arrival), next-worst 440ms, everything else ≤330ms. No outage.
  • CDP CPU profile: longest non-idle block 5.5s (was 42.6s), composed of first-dispatch lazy module loads for startup-registry plugins only (teams-meetings 3.4s + zoom-meetings 0.8s jiti source loads + embedded-runner chunk eval). No non-startup provider plugin (amazon-bedrock, opencode, etc.) loads at all.

Regression test: bounds unscoped agent loads to active runtime plugins and selected owners in src/agents/runtime-plugins.test.ts — fails pre-fix (no onlyPluginIds), passes post-fix.

Production LOC delta: +8 (helper import, invariant comment, one fallback branch). Tests +49/-1.

Follow-ups (recorded, out of scope here)

  • Hook/cron path still rebuilds plugin metadata snapshots per run (installed-plugin-index safeHashFile, doctor-contract path resolution, realpath walks — measured ~5-6s aggregate across a 13-run warm burst). Canonical fix is carrying the gateway's admitted plugin generation into hook/cron dispatch, completing fix: prevent plugin metadata rescans from stalling Gateway #125596 for this ingress.
  • prepareCronRunContext runs before the HookDispatch lane bounds anything, so N preparations run unbounded on burst admission.
  • First dispatch still cold-evaluates the embedded-runner dist chunk graph (~4-6s once per process); a post-ready background warmup would hide it.

…untime registry

First hook/cron isolated-run dispatch in a gateway process cold-loaded every
discovered plugin (~70 bundled providers) because the registry loader's
startup-scope fallback chain came up empty on that path and dropped
onlyPluginIds entirely. In dev checkouts each provider plugin loads from
TypeScript source through jiti's synchronous babel transform: a CPU profile of
a live 13-message gmail hook burst showed one contiguous 42.6s event-loop
block (36.2s extension module loading; amazon-bedrock 16.8s, opencode 13.1s),
the gateway HTTP server unresponsive for ~31s, and the fan-out handler's own
8s response deadline unable to fire - the livelock recorded in #130002.

The fallback chain now consults the process's active plugin registry before
giving up to full discovery: explicit base -> request-scope registry ->
metadata snapshot pluginIds -> active runtime plugin ids -> unrestricted.
resolveAgentRuntimePluginLoadPlan still adds the run's selected provider,
harness, memory, and context-engine owners on top, so any selected provider
outside the startup set keeps joining the immutable run generation. Hosts
with no active registry (pure library use) keep full discovery.

Live re-verification on the same rig: cold burst answered in 8.03s with the
designed 503 partial fan-out response, probe max latency 4.56s (was a 31.5s
outage), longest event-loop block 5.5s (was 42.6s), and only startup-registry
plugins load.

Follow-up of the gmail hook fan-out landing (#130002); same defect family as
the channel-path fix in #125596.
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 26, 2026 14:26
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:32 PM ET / 17:32 UTC.

ClawSweeper review

What this changes

The PR bounds isolated agent-run plugin loading to the Gateway process’s active runtime plugins while retaining the plugins explicitly selected for that run.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review. The patch is a focused owner-boundary repair for unscoped isolated-agent registry loads; no discrete correctness defect was found, but its availability-sensitive scope change still needs exact-head validation after the branch is refreshed.

Priority: P1
Reviewed head: 12b714d9eebd747eac0686f741d92fb76886cc8c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned availability fix with useful claimed live evidence; exact-head refresh and operational validation remain the material confidence reducer.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless records before/after Gateway evidence, while exact-head operational confirmation remains the merge risk.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless records before/after Gateway evidence, while exact-head operational confirmation remains the merge risk.
Evidence reviewed 6 items Changed owner boundary: The fallback now uses loaded IDs from the active registry only after explicit, request-scoped, and metadata-snapshot scopes are absent; the resulting plan still owns the final selected IDs.
Selected-owner preservation: The load-plan call receives the fallback IDs as its base and continues to resolve selections before passing onlyPluginIds to the loader.
Focused regression coverage: The new test seeds an active registry, excludes a deferred plugin, and verifies that selected provider ownership is retained in the scoped loader input.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 109.24 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.8s
node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

[tsdown-build] invocation 2/2 finished in 14.3s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4429ms (slowest: built plugin control-plane loads 3689ms)

OpenClaw 2026.8.1 (12b714d) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw

How this fits together

Hook and cron dispatches prepare an isolated agent runtime before executing work. That preparation selects a plugin registry, which determines both startup cost and the provider, harness, and tool capabilities available to the run.

flowchart LR
A[Hook or cron request] --> B[Isolated run preparation]
B --> C[Plugin registry scope selection]
C --> D{Existing scope available?}
D -->|Yes| E[Reuse scoped plugin ids]
D -->|No| F[Use active runtime plugin ids]
E --> G[Add selected run owners]
F --> G
G --> H[Prepared agent run and Gateway response]
Loading

Decision needed

Question Recommendation
After refreshing this availability-sensitive branch, is the exact-head focused test result and hook/cron Gateway smoke evidence sufficient to merge it? Refresh and verify the exact head: Rebase or otherwise refresh against current main, then attach focused-suite and hook/cron responsiveness evidence for the reviewed head.

Why: The protected maintainer label and the change to runtime plugin scope require a maintainer to accept the final operational proof, not merely the mocked load-plan assertion.

Before merge

  • Resolve merge risk (P2) - The fallback changes the plugin set for every otherwise-unscoped isolated runtime load; refresh the behind branch and confirm the focused suite plus a hook/cron Gateway smoke path on the exact head before merge.
  • Complete next step (P2) - Protected maintainer handling and exact-head operational validation are the remaining merge requirements; no mechanical repair is identified.
Agent review details

Security

None.

PR surface

Source +8, Tests +48. Total +56 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 2 +8
Tests 1 49 1 +48
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 59 3 +56

Review metrics

Metric Value Why it matters
Production versus test LOC production +8; tests +48 The small production fallback is paired with targeted coverage for the active-registry and selected-owner invariant.

Merge-risk options

Maintainer options:

  1. Refresh and re-prove the Gateway path (recommended)
    Validate the refreshed exact head with the focused regression suite and a hook/cron burst smoke trace before merging the availability-sensitive scope change.
  2. Defer to explicit generation propagation
    Pause this PR if maintainers decide the hook/cron ingress should first carry the admitted registry generation rather than rely on active-registry fallback.

Technical review

Best possible solution:

Land the scoped fallback only after exact-head focused regression coverage and a Gateway hook/cron smoke trace show that selected owners remain available while the response deadline stays live.

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

Yes—current source reproducibly shows that an unscoped load leaves onlyPluginIds unset, while the PR’s focused test establishes the intended active-registry and selected-owner boundary; no local runtime execution was performed in this read-only checkout.

Is this the best way to solve the issue?

Yes—the fallback is placed in the shared registry-load decision point and reuses the existing active-runtime ID helper, rather than adding hook- or cron-specific loading policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 772f6a3d5ea9.

Labels

Label justifications:

  • P1: Cold hook or cron bursts can leave the Gateway event loop unresponsive and delay request handling.
  • merge-risk: 🚨 availability: The PR changes runtime plugin load scope on a Gateway preparation path that directly affects responsiveness and capability availability.
  • 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. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless records before/after Gateway evidence, while exact-head operational confirmation remains the merge risk.

Evidence

What I checked:

  • Changed owner boundary: The fallback now uses loaded IDs from the active registry only after explicit, request-scoped, and metadata-snapshot scopes are absent; the resulting plan still owns the final selected IDs. (src/agents/runtime-plugins.ts:73, 12b714d9eebd)
  • Selected-owner preservation: The load-plan call receives the fallback IDs as its base and continues to resolve selections before passing onlyPluginIds to the loader. (src/agents/runtime-plugins.ts:87, 12b714d9eebd)
  • Focused regression coverage: The new test seeds an active registry, excludes a deferred plugin, and verifies that selected provider ownership is retained in the scoped loader input. (src/agents/runtime-plugins.test.ts:131, 12b714d9eebd)
  • Current-main comparison: Current main does not contain the active-runtime fallback or its regression test, so this remains a distinct open contribution rather than an implemented-on-main close. (src/agents/runtime-plugins.ts:73, 772f6a3d5ea9)
  • History and ownership: The proposed fallback lines are attributed to this PR head; the surrounding current-main implementation dates to Peter Steinberger’s recent runtime-registry work. (src/agents/runtime-plugins.ts:73, 12b714d9eebd)
  • Repository policy: The agents and plugins scoped guidance favors lifecycle-owned registry facts and explicit activation planning, matching this fallback shape; the changed test targets the registry boundary rather than a test-only production seam. (src/plugins/AGENTS.md:18, 12b714d9eebd)

Likely related people:

  • steipete: Authored this focused change and the earlier merged Gateway registry-lifecycle repair referenced by the PR, with nearby current-main history also attributed to Peter Steinberger. (role: recent runtime-registry contributor; confidence: high; commits: 12b714d9eebd, fd216cb5509e, ba8e03fb9c6c; files: src/agents/runtime-plugins.ts, src/agents/runtime-plugins.test.ts, src/plugins/active-runtime-registry.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh against current main and run the focused registry suite on the exact head.
  • Capture a redacted hook/cron Gateway smoke trace showing the response deadline remains responsive under a cold burst.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T14:33:27.755Z sha 12b714d :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 93d879d into main Aug 27, 2026
278 of 279 checks passed
@steipete
steipete deleted the claude/adoring-tesla-d45d0b branch August 27, 2026 00:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 27, 2026
…ated runs (#130581)

Hook dispatch and the cron scheduler rebuilt process-stable plugin metadata
on every isolated run: prepareCronRunContext reloaded a metadata snapshot
per run inside loadAgentRuntimePluginRegistryHandle (installed-plugin-index
safeHashFile ~2.2s, doctor contract artifact resolution ~1.8s, realpathSync
walks), and the embedded orchestrator rebuilt-and-froze another snapshot
plus a fresh prepared-runtime owner per run — ~5-6s aggregate synchronous
work across a 13-run gmail hook burst even after #130167 removed the cold
full-registry load.

The channel path already carries dispatchRuntime.pluginGeneration (#125596)
and the gateway agent RPC carries commandRuntimeContext.pluginGeneration.
This completes the same carry at the isolated-run owner:
prepareCronRunContext reuses the published model-catalog owner's
metadataSnapshot for the run registry handle, and runCronIsolatedAgentTurn
admits the published Gateway generation (static prepared-runtime lease +
withPreparedModelRuntimePluginGenerationScope with a borrow accessor,
mirroring runPreparedReply) so the embedded orchestrator reuses the
generation instead of rebuilding it. Standalone hosts and
startup/replacement races keep generation-free execution.

Live proof on an isolated dev gateway: plugins.metadata.scan timeline spans
stayed at the 22 startup scans across two full isolated cron runs (zero
per-run rebuilds); regression tests fail pre-fix.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…untime registry (openclaw#130167)

First hook/cron isolated-run dispatch in a gateway process cold-loaded every
discovered plugin (~70 bundled providers) because the registry loader's
startup-scope fallback chain came up empty on that path and dropped
onlyPluginIds entirely. In dev checkouts each provider plugin loads from
TypeScript source through jiti's synchronous babel transform: a CPU profile of
a live 13-message gmail hook burst showed one contiguous 42.6s event-loop
block (36.2s extension module loading; amazon-bedrock 16.8s, opencode 13.1s),
the gateway HTTP server unresponsive for ~31s, and the fan-out handler's own
8s response deadline unable to fire - the livelock recorded in openclaw#130002.

The fallback chain now consults the process's active plugin registry before
giving up to full discovery: explicit base -> request-scope registry ->
metadata snapshot pluginIds -> active runtime plugin ids -> unrestricted.
resolveAgentRuntimePluginLoadPlan still adds the run's selected provider,
harness, memory, and context-engine owners on top, so any selected provider
outside the startup set keeps joining the immutable run generation. Hosts
with no active registry (pure library use) keep full discovery.

Live re-verification on the same rig: cold burst answered in 8.03s with the
designed 503 partial fan-out response, probe max latency 4.56s (was a 31.5s
outage), longest event-loop block 5.5s (was 42.6s), and only startup-registry
plugins load.

Follow-up of the gmail hook fan-out landing (openclaw#130002); same defect family as
the channel-path fix in openclaw#125596.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…ated runs (openclaw#130581)

Hook dispatch and the cron scheduler rebuilt process-stable plugin metadata
on every isolated run: prepareCronRunContext reloaded a metadata snapshot
per run inside loadAgentRuntimePluginRegistryHandle (installed-plugin-index
safeHashFile ~2.2s, doctor contract artifact resolution ~1.8s, realpathSync
walks), and the embedded orchestrator rebuilt-and-froze another snapshot
plus a fresh prepared-runtime owner per run — ~5-6s aggregate synchronous
work across a 13-run gmail hook burst even after openclaw#130167 removed the cold
full-registry load.

The channel path already carries dispatchRuntime.pluginGeneration (openclaw#125596)
and the gateway agent RPC carries commandRuntimeContext.pluginGeneration.
This completes the same carry at the isolated-run owner:
prepareCronRunContext reuses the published model-catalog owner's
metadataSnapshot for the run registry handle, and runCronIsolatedAgentTurn
admits the published Gateway generation (static prepared-runtime lease +
withPreparedModelRuntimePluginGenerationScope with a borrow accessor,
mirroring runPreparedReply) so the embedded orchestrator reuses the
generation instead of rebuilding it. Standalone hosts and
startup/replacement races keep generation-free execution.

Live proof on an isolated dev gateway: plugins.metadata.scan timeline spans
stayed at the 22 startup scans across two full isolated cron runs (zero
per-run rebuilds); regression tests fail pre-fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

1 participant