fix(plugins): retain plugin tool registry after replacement#82562
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 9:22 AM ET / 13:22 UTC. Summary PR surface: Source +46, Tests +60. Total +106 across 5 files. Reproducibility: yes. at source level. Current main and v2026.6.10 still contain the cached descriptor plus forced standalone registry path without retained registry state, and the linked issue plus PR body provide concrete runtime evidence. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the descriptor-scoped registry retention fix after plugin/runtime owner signoff and current changed-lane validation, while preserving request-local tool-discovery behavior. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main and v2026.6.10 still contain the cached descriptor plus forced standalone registry path without retained registry state, and the linked issue plus PR body provide concrete runtime evidence. Is this the best way to solve the issue? Yes, conditionally. Descriptor-scoped retention is the narrowest fix I found for the cached-descriptor path, while globally installing the recovery registry would conflict with request-local tool-discovery behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7844b0844568. Label changesLabel justifications:
Evidence reviewedPR surface: Source +46, Tests +60. Total +106 across 5 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Addressed the ClawSweeper P2 in 865ba9b. The forced cold-loaded recovery registry is no longer installed into global active state; cached descriptor execution now retains it in descriptor-scoped state and reuses that scoped registry only for the cached descriptor path. Added regression coverage to the existing cached lifecycle test so an unrelated active registry tool remains in the active registry after both cached descriptor executions. Local verification after the fix:
Updated the PR body with new live terminal output showing cached descriptor execution succeeds while the unrelated active registry owner remains |
865ba9b to
3557b86
Compare
3557b86 to
d71aaaf
Compare
|
@clawsweeper re-review Requesting a fresh review to refresh stale rating/status labels. Current durable review says needs maintainer review before merge, proof is sufficient, and there is no repair lane, but the PR labels only show proof/P2/impact without rating/status. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Tiny Review Wisp Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
d71aaaf to
26fe283
Compare
|
Rebased this PR onto current origin/main and addressed the ClawSweeper installRecords finding in head 26fe283.\n\nMaintenance summary:\n- Preserved current-main PluginRuntimeLoadContext.installRecords propagation.\n- Kept buildPluginRuntimeLoadOptionsFromValues passing installRecords through to PluginLoadOptions.\n- Kept current main's ownerOnly removal; no ownerOnly plumbing is restored.\n- Kept the PR's final metadata snapshot behavior so manifestRegistry and installRecords now come from the final snapshot after auto-enable/config resolution.\n\nLocal validation:\n- OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs run --config test/vitest/vitest.plugins.config.ts src/plugins/tools.optional.test.ts --testNamePattern 'retains cold-loaded plugin tools' -> 1 passed\n- OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs run --config test/vitest/vitest.plugins.config.ts src/plugins/tools.optional.test.ts src/plugins/active-runtime-registry.test.ts src/plugins/runtime.channel-pin.test.ts -> 3 files passed, 78 tests passed\n- pnpm check:changed --base origin/main -> passed\n- git diff --check origin/main..HEAD -> passed\n- gitleaks protect --staged --redact -> no leaks found\n\nNote: crabbox-wrapper could not run from this executor because the local crabbox AWS provider has no available credentials/IMDS role, so I used local pnpm check:changed against origin/main for the changed-lane validation.\n\n@clawsweeper re-review |
a5d760f to
cc44983
Compare
|
Rebased onto current Local verification on the rebased head Note: |
|
Addressed the ClawSweeper P3 changelog finding in head Change:
Local verification: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Heads up: this PR needs to be updated against current |
8c5b4be to
a971bc5
Compare
|
Rebased onto current New head: Local validation passed after rebase: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Refreshed this branch onto current Validation run locally:
Note: full staged @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
Thanks @luoyanglang! |
Summary
plugin tool runtime missing.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
Behavior or issue addressed: cached plugin tool descriptors continue executing after active runtime registry replacement instead of failing with
plugin tool runtime missing.Real environment tested: Linux x86_64 dev executor, Node v22.22.2, local OpenClaw runtime harness with a real config-path plugin loaded through
resolvePluginTools().Exact steps or command run after this patch:
node --import tsx --input-type=modulelocal runtime harness: create a config-path plugin withcontracts.tools, resolve/capture cached plugin descriptors, replace the active registry with an incomplete registry for the same plugin id plus an unrelated live tool, then execute the cached descriptor twice.OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs run --config test/vitest/vitest.plugins.config.ts src/plugins/tools.optional.test.ts --testNamePattern 'retains cold-loaded plugin tools'OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=120000 node scripts/run-vitest.mjs run --config test/vitest/vitest.plugins.config.ts src/plugins/tools.optional.test.ts src/plugins/active-runtime-registry.test.ts src/plugins/runtime.channel-pin.test.tspnpm check:changedEvidence after fix: copied live terminal output from the local OpenClaw runtime harness shows the cached descriptor executing twice after incomplete active registry replacement while unrelated active registry tools survive; targeted regression tests, related plugin registry tests, and
pnpm check:changedalso passed locally.Live terminal output from a local OpenClaw runtime harness after this patch:
Observed result after fix: first cached descriptor execution returned
live-runtime-ok-1; the unrelated active registry owner remainedunrelated-liveafter both executions; the second execution returnedlive-runtime-ok-2using the retained scoped recovery registry without replacing global active state.What was not tested: the reporter's private
lossless-clawplugin and live five-minute sub-agent archival loop were not available here. Crabbox CLI was installed locally, but remote AWS Crabbox proof was blocked by missing local Crabbox/AWS auth (broker=- auth=missing;crabbox doctorfailed at AWS credentials), so no remote Crabbox run is claimed.Before evidence: the new regression failed before the fix with
plugin tool runtime unavailable (cache-lifecycle-test): cached_lifecycle_toolon the second cached descriptor execution.Root Cause (if applicable)
resolvePluginToolRegistry()forced a cold standalone load when an active/channel registry existed but did not cover the requested plugin tools, but that successful cold-loaded registry was not retained for later cached descriptor executions.Regression Test Plan (if applicable)
src/plugins/tools.optional.test.tsUser-visible / Behavior Changes
Contracted plugin tools remain available across registry replacement/sub-agent lifecycle changes instead of intermittently failing until gateway restart.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
Expected
Actual
plugin tool runtime unavailable.Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations