Skip to content

improve(doctor): avoid repeated plugin metadata scans - #119482

Merged
vincentkoc merged 6 commits into
mainfrom
perf/doctor-plugin-metadata-context-20260805
Aug 5, 2026
Merged

vincentkoc merged 6 commits into
mainfrom
perf/doctor-plugin-metadata-context-20260805

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Closes #119481

Problem

An exact-main Kova diagnostic found 553 completed plugins.metadata.scan spans in each plugin-heavy gateway-performance record. The dominant Doctor process accounted for 493 of them, roughly 15-17 seconds of aggregate synchronous scan work, even though Doctor preflight had already loaded the authoritative plugin inventory.

Baseline evidence: https://github.com/openclaw/openclaw/actions/runs/30973747306

Root Cause

Normal openclaw doctor preflight prepared plugin-aware config but did not retain a complete PluginMetadataSnapshot for the rest of the lifecycle. Config repair, configured-channel discovery, health checks, per-agent checks, preview warnings, and status helpers therefore fell back to independent metadata loads. Workspace-specific checks also needed an explicit scope transition rather than reuse of a default-workspace snapshot.

Later health contributions can rewrite plugin manifests, install configured plugins, repair host links, or refresh the persisted registry. Those mutations occurred after the initial Doctor generation was prepared, so subsequent tool and provider discovery could reuse stale metadata unless the lifecycle owner explicitly invalidated it.

Fix

  • Prepare and retain a complete metadata snapshot during normal Doctor preflight, not only checkpointed migration paths.
  • Add a Doctor-owned scope runner that reuses one immutable compatible snapshot per workspace.
  • Carry snapshots through nested async lookups with AsyncLocalStorage, while allowing inner per-agent workspace scopes to override and then restore the outer scope.
  • Run config compatibility, configured-channel setup and cleanup, mutable warnings, repair discovery, health, preview, skills, tool-schema, provider, and workspace checks inside the appropriate scope.
  • Share the current snapshot generation with repair sequencing instead of passing an isolated snapshot value.
  • Have each installed-plugin repair producer report whether it changed authoritative inventory, including cleanup-only package or install-record removal.
  • Replace the shared base snapshot immediately after any successful inventory mutation, then carry the refreshed generation into later channel and plugin discovery.
  • Expose a Doctor-owned invalidation hook for health-stage manifest, configured-install, registry, and host-link repairs; no-op registry refreshes compare immutable inventory fingerprints and keep the current generation.
  • Run active tool-schema discovery after plugin repair contributions so each workspace loads the repaired generation once.
  • Make status snapshot reads use the same scoped resolver.

This does not add or change config, defaults, public APIs, storage schemas, migrations, or fallback behavior.

User Impact

Doctor keeps plugin metadata work bounded by lifecycle and workspace rather than multiplying it by every downstream stage. Plugin-count growth no longer increases the scan count for the same workspace, while distinct agent workspaces still receive independently compatible metadata. Repairs that change manifests or installed inventory now force the next diagnostic to observe the repaired generation instead of stale provider or tool facts.

ClawSweeper Follow-Through

The exact-head patch and proof resolve every item from the latest review:

  • configured-channel setup, cleanup, mutable warnings, and repair discovery run under the Doctor metadata lifecycle;
  • repair sequencing uses the shared generation and preserves the post-inventory-mutation refresh;
  • the post-inventory refresh reloads the current default-workspace scope and environment consumed by later Doctor readers;
  • cleanup-only and health-stage manifest, configured-install, registry, and host-link mutations invalidate every derived workspace scope before provider and tool discovery;
  • invalidation clears scoped metadata even when no replacement snapshot is available;
  • no-op registry refreshes compare stable inventory fingerprints and avoid unnecessary invalidation;
  • the exact-head 523-test matrix plus 198 focused final regressions cover preview, repair, workspace isolation, configured-channel paths, mutation refresh, and stale-model preservation;
  • exact-head CI and Kova are complete and successful.

Verification

  • Exact base: 26a58bcd92baeb8ed6595d5202b16bd4e08be704
  • Exact head: ff416393255918172633e82a4d6f7f1d9e4f1ff4
  • Latest main at final evidence review on August 5, 2026: a52b336f260f7d074bf4f33d05952902584a81b0. The latest intervening changes cover Windows exec decoding and Matrix QA account isolation; no changed file overlaps this PR.
  • Exact-head CI passed with no failed or pending checks: https://github.com/openclaw/openclaw/actions/runs/30997434885
  • Exact-head Kova passed every workflow job against OpenClaw ff416393255918172633e82a4d6f7f1d9e4f1ff4 and Kova dfafaff9dcd49b9c76788c6260f1f72dd2ced593: https://github.com/openclaw/openclaw/actions/runs/30997538679
  • All three plugin-heavy gateway records measured exactly 134 completed metadata scans, with 73 in the dominant Doctor process.
  • Doctor topology was stable in every record: 59 configless/default-workspace scans without an installed index, 13 workspace scans without an installed index, and 1 workspace scan with the installed index.
  • Median aggregate scan time was 4,538.703 ms overall and 2,253.617 ms in Doctor.
  • Versus the current-Kova production ancestor at 187 total and 126 Doctor scans, counts fell 28.3% overall and 42.1% in Doctor; median scan time fell 33.4% overall and 52.4% in Doctor.
  • Versus the original 553/493 baseline, counts fell 75.8% overall and 85.2% in Doctor.
  • The exact-head changed-test matrix passed 523 tests across 15 focused files and four Vitest shards.
  • An additional 198 focused final-regression tests passed across process flow, health invalidation, and config/state repair coverage.
  • Changed-file oxfmt, oxlint --deny-warnings, git diff --check, and the dead-code export check passed.

The Kova mock lane still crosses the existing 1,050 MB gateway RSS threshold (1,144.7 MB median, 1,189.5 MB max), and the source concurrency probe still shows roughly 19.5-second p99 control-plane latency. Those are separate startup/runtime hotspots: plugin load failures and missing dependency errors were zero, and neither warning changes the exact Doctor scan-count result.

Change Shape

  • Source: +1042/-446, net +596
  • Tests: +898/-8, net +890
  • The production growth is the lifecycle-owned async scope, one per-workspace snapshot runner, explicit workspace transitions, shared generation refresh/invalidation, stable inventory-change facts, and health-stage mutation propagation. Duplicate Doctor contract/state plumbing and repeated downstream snapshot loads were removed.

Punchcard-Session: coral-workshop-workshop-3f

@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: L maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 6:46 AM ET / 10:46 UTC.

ClawSweeper review

What this changes

The PR makes OpenClaw Doctor retain a compatible plugin-metadata snapshot per workspace, reuse it across diagnostics, and refresh or invalidate it after inventory repairs.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness or security defect was found in the exact PR head. This remains open for explicit maintainer acceptance because it is maintainer-authored and changes the Doctor lifecycle that governs plugin, provider, and tool discovery.

Priority: P2
Reviewed head: ff416393255918172633e82a4d6f7f1d9e4f1ff4
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent owner boundary and substantial focused coverage, with final merge acceptance appropriately reserved for the responsible maintainer.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless supplies exact-head Kova and CI evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless supplies exact-head Kova and CI evidence.
Evidence reviewed 6 items Current-main root cause: Current main invokes Doctor preflight without requesting a retained metadata snapshot, leaving later checks to perform their own resolution.
Lifecycle-owned repair: The PR requests preflight metadata, stores the current generation in the Doctor flow, and clears both the base generation and workspace cache on invalidation.
Compatibility and invalidation boundary: The new scope reuses snapshots only when config and workspace compatibility hold, and clears all derived workspace generations when its base changes or is invalidated.
Findings None None.
Security None None.

How this fits together

Doctor reads configuration and plugin manifests before running repair, health, provider, tool, and status diagnostics. This change carries that metadata through those downstream checks while ensuring inventory mutations cause a fresh generation to be used.

flowchart TD
  A[Doctor preflight] --> B[Plugin metadata snapshot]
  B --> C[Workspace snapshot scope]
  C --> D[Config repair and health checks]
  D --> E{Plugin inventory changed?}
  E -->|No| F[Reuse compatible snapshot]
  E -->|Yes| G[Clear and reload generation]
  F --> H[Provider, tool, and status diagnostics]
  G --> H
Loading

Decision needed

Question Recommendation
Does the Doctor/plugin owner accept this cache lifecycle and its invalidation coverage as the canonical approach for provider and tool discovery during a Doctor run? Accept the scoped lifecycle: Land the PR with the current explicit refresh and invalidation boundaries for inventory-changing repairs.

Why: The patch is source-consistent and covered, but a maintainer must own the operational tradeoff of caching plugin inventory across Doctor repair stages.

Before merge

  • Resolve merge risk (P1) - The new Doctor-scoped cache influences plugin-owned provider and tool discovery; an unrecognized future inventory-mutating repair could retain stale capability facts for the remainder of one Doctor run.
Agent review details

Security

None.

PR surface

Source +596, Tests +890. Total +1486 across 41 files.

View PR surface stats
Area Files Added Removed Net
Source 28 1042 446 +596
Tests 13 898 8 +890
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 41 1940 454 +1486

Review metrics

Metric Value Why it matters
Production versus regression coverage production +1,042/-446; tests +898/-8 The large production increase is tied to a named lifecycle ownership boundary and is accompanied by focused scope, mutation, and process coverage.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-flow.test.ts, migration/backfill/repair: src/commands/doctor-config-flow.ts, migration/backfill/repair: src/commands/doctor-config-preflight-plugin-index.ts, migration/backfill/repair: src/commands/doctor-config-preflight.process.test.ts, migration/backfill/repair: src/commands/doctor-config-preflight.state-migration-input.test.ts, migration/backfill/repair: src/commands/doctor-config-preflight.state-migration.test.ts, and 68 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119481
Summary: This PR is the candidate implementation for the documented repeated Doctor metadata-load defect.

Members:

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

Merge-risk options

Maintainer options:

  1. Accept the owner-reviewed cache lifecycle (recommended)
    Land after the responsible maintainer accepts that the explicit invalidation paths cover the compatibility and provider-discovery risk.
  2. Pause for additional mutation proof
    Hold the PR if maintainers identify another inventory-mutating Doctor stage that requires a refresh regression before merge.

Technical review

Best possible solution:

Keep the lifecycle-owned, per-workspace snapshot design and land it only after a Doctor/plugin owner accepts the explicit invalidation coverage for manifest, registry, install, and host-link repairs.

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

Yes. Current-main source shows normal Doctor preflight discards the reusable metadata handoff, and the exact-head process test provides a focused plugin-heavy lifecycle path; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. A Doctor-owned per-workspace scope is a better fit than a global cache because it preserves config and workspace compatibility while keeping mutation invalidation at the lifecycle owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs avoidable repeated diagnostic work in plugin-heavy Doctor runs without blocking normal operator workflows.
  • merge-risk: 🚨 compatibility: Caching metadata across Doctor stages can change which installed plugins and manifests later checks observe after repairs.
  • merge-risk: 🚨 auth-provider: Doctor uses plugin metadata to determine provider ownership and stale-agent-model handling, so stale invalidation would affect provider diagnosis.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR body nevertheless supplies exact-head Kova and CI evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the exact-head metadata-refresh follow-up and is the strongest available owner signal for the repair lifecycle. (role: recent Doctor repair contributor; confidence: high; commits: 94fec60b9a63; files: src/commands/doctor/repair-sequencing.ts, src/commands/doctor-config-flow.ts)
  • Syu: Current-main blame attributes the Doctor preflight call site that lacks retained metadata to this contributor; older origin history is incomplete locally. (role: current-main boundary contributor; confidence: low; commits: b316c9cacf69; files: src/commands/doctor-config-flow.ts)

Rank-up moves

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

  • Have the Doctor/plugin owner make the final cache-lifecycle acceptance decision.

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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T08:28:21.368Z sha c0ecc69d51269241bf316f85ca90e3f16b142019 :: needs changes before merge. :: [P1] Scope channel and repair discovery under Doctor metadata lifecycle
  • reviewed 2026-08-05T09:05:06.548Z sha 6a541cf2e738f5a02e400c5dd51dc00c75f8ec49 :: needs changes before merge. :: [P1] Refresh metadata for the default workspace
  • reviewed 2026-08-05T09:18:24.572Z sha 72121c4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T09:37:30.900Z sha 72121c4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T10:06:48.245Z sha 57beef3 :: needs changes before merge. :: [P1] Invalidate the scope cache when preflight has no snapshot
  • reviewed 2026-08-05T10:13:46.633Z sha 57beef3 :: found issues before merge. :: [P1] Clear scoped metadata on every invalidation
  • reviewed 2026-08-05T10:24:30.404Z sha fd1cded :: needs maintainer review before merge. :: none
  • reviewed 2026-08-05T10:33:23.541Z sha ff41639 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 75044b68519af512579e12d7458f838105de754c.

The previous Before merge and Rank-up items are now implemented:

  • normal non-checkpointed Doctor preflight prepares the complete metadata snapshot;
  • full normal Doctor config + health + preview/repair process tests prove plugin-count-flat scans and explicit per-workspace scaling;
  • exact-head Kova evidence is in the PR body (553 -> 193 total scans; dominant Doctor process 493 -> 132).

Please evaluate the complete current diff and list every remaining Before merge and Rank-up move explicitly.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the perf/doctor-plugin-metadata-context-20260805 branch 2 times, most recently from 990d477 to ce0e9c4 Compare August 5, 2026 07:34
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@vincentkoc
vincentkoc force-pushed the perf/doctor-plugin-metadata-context-20260805 branch from ce0e9c4 to c393794 Compare August 5, 2026 08:02
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the perf/doctor-plugin-metadata-context-20260805 branch from c393794 to c0ecc69 Compare August 5, 2026 08:22
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the perf/doctor-plugin-metadata-context-20260805 branch from c0ecc69 to 6a541cf Compare August 5, 2026 08:49
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 5, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 5, 2026
Punchcard-Session: coral-workshop-workshop-3f
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 5, 2026
Punchcard-Session: coral-workshop-workshop-3f
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact-head merge evidence is now attached to the PR body for ff416393255918172633e82a4d6f7f1d9e4f1ff4:

  • CI completed successfully with no failed or pending checks.
  • Kova completed successfully and measured 134 total metadata scans and 73 Doctor scans in all three runs.
  • The focused regression matrix covers inventory-mutation invalidation, cleanup-only changes, workspace isolation, and invalidation without a replacement snapshot.

Please refresh the durable review against this exact head and clear or restate every Before merge and Rank-up moves item.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer disposition for the latest ClawSweeper review of exact head ff416393255918172633e82a4d6f7f1d9e4f1ff4:

  • Before merge: accepted and resolved. The Doctor-owned, per-workspace metadata snapshot with explicit invalidation and replacement is the canonical lifecycle for this repair.
  • Any future Doctor repair that mutates installed plugin inventory must invalidate or replace this owner-managed generation before later provider or tool discovery. Adding such a mutation without that path is a correctness bug and must include boundary regression coverage.
  • Rank-up move: applied. I accept the cache-lifecycle decision.

No ClawSweeper finding is being skipped. Exact-head CI and exact-head Kova evidence are published in the PR body.

@vincentkoc
vincentkoc merged commit 80da616 into main Aug 5, 2026
134 of 138 checks passed
@vincentkoc
vincentkoc deleted the perf/doctor-plugin-metadata-context-20260805 branch August 5, 2026 11:06
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Post-merge exact-head proof

Reviewed PR head ff416393255918172633e82a4d6f7f1d9e4f1ff4 merged as 80da61668eb6445d6430a8513301c222d820c9c0. The canonical main checkout is synchronized and every file changed by the reviewed head matches the merged tree.

The root cause was lifecycle ownership: Doctor prepared plugin metadata during preflight but discarded it, so later config, repair, health, status, tool-schema, and per-workspace checks independently rescanned the same inventory. The final repair carries one immutable compatible generation per workspace, invalidates both base and derived workspace generations after manifest/install/registry mutations, and runs runtime tool discovery after plugin repair.

Proof:

  • Exact-head Kova diagnostic: https://github.com/openclaw/openclaw/actions/runs/30999602734 — all Kova, source-performance, and artifact-validation jobs passed. The plugin-heavy gateway-performance deep-profile record completed 51 plugins.metadata.scan spans with zero errors or open spans, down from the 553-span baseline (90.8% reduction).
  • Blacksmith Testbox tbx_01kz8qr3cqqt6jr0mpxjnhhxfn (backing run https://github.com/openclaw/openclaw/actions/runs/30997885353): 99 focused exact-head Doctor lifecycle tests passed, including updater-without-base invalidation and bounded one-vs-twelve plugin/agent scan matrices.
  • pnpm check:changed passed on the exact head, including core/test typechecks, lint, import cycles, database-first guards, and boundary checks.
  • OPENCLAW_STATE_DIR=$(mktemp -d) pnpm dev qa suite --provider-mode mock-openai --concurrency 8 passed 126 scenarios, failed 0, and skipped 7 expected optional-tool scenarios across 133 total. Both prior pressure failures (active-memory-preprompt-recall and subagent-fanout-synthesis) passed; Control UI Chromium scenarios also passed.
  • Full-branch AutoReview completed with no accepted/actionable findings. Exact-head ClawSweeper found no correctness or security finding.

Linked issue #119481 is closed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* perf(doctor): reuse plugin metadata snapshot

Punchcard-Session: coral-workshop-workshop-3f

* test(doctor): update legacy issue mock

Punchcard-Session: coral-workshop-workshop-3f

* fix(doctor): refresh metadata after repairs

* test(doctor): type legacy issue mock arguments

Punchcard-Session: coral-workshop-workshop-3f

* fix(doctor): invalidate scoped plugin metadata

Punchcard-Session: coral-workshop-workshop-3f

* fix(doctor): keep snapshot scope type private

Punchcard-Session: coral-workshop-workshop-3f

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

[Bug]: Doctor repeatedly reloads plugin metadata across one lifecycle

2 participants