Skip to content

fix(plugins): preserve metadata reloads during models status - #119183

Merged
vincentkoc merged 2 commits into
mainfrom
fix/plugin-metadata-snapshot-cas
Aug 4, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/plugin-metadata-snapshot-cas

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where operators running openclaw models status could lose a newer plugin metadata publication when a config reload, plugin install, Doctor repair, or lifecycle clear completed while the command was awaiting catalog work.

The command previously captured process-global metadata and unconditionally restored that stale state during cleanup.

Why This Change Was Made

The plugin metadata lifecycle owner now exposes a temporary publication lease. Each publication rotates an opaque revision token; cleanup restores the full prior composite state only while its own publication is still current. Authoritative set/clear operations win, nested leases unwind safely, and exact manifest model-normalization records are restored without re-deriving them from changed environment state.

The old raw capture/restore exports and their test-only borrowers are removed. There are no config, storage, SQLite schema, protocol, or plugin SDK changes.

User Impact

Plugin metadata refreshed during models status remains authoritative instead of being silently replaced by stale command state. Ordinary serial command behavior is unchanged.

Evidence

  • Exact base: 121c6c10423827ce8a65118600f3498e20b8f6e0.
  • Exact head: d28d2bd6a7acf0cfeeb0f11017434bb33f9dab5e (signed).
  • Reproduced execution order: temporary command publication -> async catalog wait -> lifecycle clear -> republish the same snapshot object -> command cleanup. The newer publication survives.
  • Focused Vitest: 393/393 passed across plugin snapshot leases, models status, Gateway chat, system-agent rebinds, QA media flow, and compact harness loading.
  • Exact test-only CI repair: the snapshot fixture now constructs a valid PluginManifestRecord and keeps the manifest registry's plugin list mutable; its focused file passes 27/27.
  • Lease coverage includes lifecycle clear, authoritative replacement, nested out-of-order release, idempotent release, config identity, and exact model-normalization restoration.
  • oxfmt, scoped oxlint, and git diff --check: passed.
  • Changed-path gate passed conflict, ratchet, boundary, dependency, format, SDK, dead-export, temp-path, and script-declaration checks.
  • The exact local core test-type run no longer reports either CI diagnostic from the changed fixture. The full linked-checkout lane still stops on the untouched current-main error at packages/terminal-core/src/ansi.ts:194:38 and a missing generated UI package surface; exact-head CI is the authoritative type gate.
  • Exact-commit autoreview: clean, no actionable findings.
  • Delta: production +136/-52 (net +84); tests/support +186/-49 (net +137).
  • Build not run locally: no build output, packaging, lazy module, bundled asset, or published surface changes; exact-head CI is the full build gate.

AI-assisted implementation; the exact diff, tests, lifecycle behavior, and commit were reviewed by the maintainer.

@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 4, 2026 10:27
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

Exact head d1ab9948c9e336ebd2bac24eb9c23199c8abb5a1 is signed and based on current main 121c6c10423827ce8a65118600f3498e20b8f6e0.

  • 393 focused tests pass across the command, lifecycle owner, and migrated test borrowers.
  • The reproduced clear-then-republish race preserves the newer publication.
  • Dead-export checks pass after removing the raw capture/restore API.
  • Exact-commit autoreview is clean.
  • The PR body records the full owner boundary, LOC split, and the unrelated current-main terminal-core typecheck baseline.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head d28d2bd6a7acf0cfeeb0f11017434bb33f9dab5e.

The prior exact-head CI type failures were test-fixture defects and are repaired without production changes:

  • the fixture now constructs a complete PluginManifestRecord
  • the manifest registry receives a mutable plugin array instead of a readonly snapshot view
  • the focused file passes 27/27
  • scoped format, lint, diff checks, and exact-commit autoreview are clean
  • the local core test-type run no longer reports either changed-file diagnostic

Exact-head GitHub CI is running and remains a hard merge gate.

Please publish or refresh the durable review, including every Before merge and Rank-up moves: item. This PR will not be merged until those lists are clear and exact-head CI is green.

@clawsweeper

clawsweeper Bot commented Aug 4, 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 7:18 AM ET / 11:18 UTC.

ClawSweeper review

What this changes

The PR replaces unconditional temporary plugin-metadata restoration during models status with revision-aware leases that preserve later lifecycle publications.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness or security finding: this is a coherent lifecycle-owner repair for a current-main stale-state race. Keep it open for the required human landing decision because it is MEMBER-authored and carries the protected maintainer label.

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

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch cleanly repairs the lifecycle ownership boundary with focused ordering coverage and no actionable review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor real-behavior-proof gate does not apply to this MEMBER-authored PR; its body nevertheless documents the after-fix deferred lifecycle sequence and focused validation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor real-behavior-proof gate does not apply to this MEMBER-authored PR; its body nevertheless documents the after-fix deferred lifecycle sequence and focused validation.
Evidence reviewed 4 items Current-main root cause: Current main captures the prior snapshot, publishes command metadata, then unconditionally restores the captured state during cleanup, allowing an awaited command to overwrite a later lifecycle publication.
Owner-boundary repair: The PR moves the guard into the metadata lifecycle owner: direct authoritative publication invalidates active leases, and release restores only when its revision remains current.
Regression coverage: The focused test holds catalog loading, clears and republishes metadata, then proves command cleanup leaves the newer publication in place; companion tests cover clear, replacement, idempotence, nested release, and normalization restoration.
Findings None None.
Security None None.

How this fits together

Plugin metadata is process-wide control-plane state used by model-status and gateway paths to resolve plugin-backed model behavior. A command may temporarily publish metadata while catalog work runs, while gateway startup, reload, Doctor, or lifecycle clearing can authoritatively replace that state.

flowchart LR
  A[Models status command] --> B[Temporary metadata lease]
  C[Gateway reload or lifecycle clear] --> D[Authoritative publication]
  B --> E[Revision-aware release]
  D --> E
  E --> F[Current plugin metadata]
  F --> G[Model and gateway lookups]
Loading

Decision needed

Question Recommendation
Should this maintainer-authored lifecycle repair be landed after confirming the exact head's live required CI and GitHub mergeability? Land after live recheck: Confirm the current head still has the required successful checks and is mergeable, then land the reviewed owner-boundary repair.

Why: The PR is authored by a repository MEMBER and has the protected maintainer label, so automated cleanup must not make the landing decision.

Before merge

None.

Agent review details

Security

None.

PR surface

Source +78, Tests +143. Total +221 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 146 68 +78
Tests 4 176 33 +143
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 322 101 +221

Review metrics

Metric Value Why it matters
Production versus test LOC production +136/-52 (net +84); tests/support +186/-49 (net +137) The production growth is justified by centralizing the revision and exact normalization-record state at the lifecycle owner rather than retaining consumer-side restore logic.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/plugins/current-plugin-metadata-snapshot.test.ts, unknown-data-model-change: src/plugins/current-plugin-metadata-snapshot.ts, unknown-data-model-change: src/plugins/current-plugin-metadata-state.ts, vector/embedding metadata: src/commands/models/list.status.test.ts, vector/embedding metadata: src/gateway/server.chat.gateway-server-chat-b.test.ts, vector/embedding metadata: src/plugins/current-plugin-metadata-snapshot.test.ts, and 4 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Adopt the revision-aware lease as the canonical process-local metadata lifecycle rule so authoritative clear and republish operations always win over temporary command cleanup.

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

Yes—current main’s unconditional cleanup is directly traceable, and the PR’s deferred catalog test reproduces the clear, republish, then cleanup ordering that exposes it.

Is this the best way to solve the issue?

Yes—the revision belongs with the process-wide metadata lifecycle owner, which protects command cleanup and every future temporary publisher without consumer-specific guards.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

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

Label justifications:

  • P2: The race can silently leave process-wide plugin metadata stale during normal model-status activity, but it has a bounded surface and repair.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor real-behavior-proof gate does not apply to this MEMBER-authored PR; its body nevertheless documents the after-fix deferred lifecycle sequence and focused validation.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Blame attributes the current snapshot capture/restore path to this author, who also authored the proposed lifecycle repair. (role: feature and current-path author; confidence: high; commits: 31a6d096a152, d1ab9948c9e3, d28d2bd6a7ac; files: src/plugins/current-plugin-metadata-snapshot.ts, src/plugins/current-plugin-metadata-state.ts, src/commands/models/list.status-command.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-04T11:06:32.727Z sha d28d2bd :: needs maintainer review before merge. :: none
  • reviewed 2026-08-04T11:13:58.918Z sha d28d2bd :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact-head maintainer review is complete for d28d2bd6a7acf0cfeeb0f11017434bb33f9dab5e.

  • Required exact-head repository CI is complete and green, including openclaw/ci-gate; there are no pending or failing core CI jobs.
  • The latest durable review reports no source finding and no security concern.
  • The revision-aware lease is the accepted owner-boundary fix: temporary publishers restore only while their publication remains current, so a newer lifecycle publication is preserved.
  • The focused regression reproduces the original deferred ordering and verifies the newer clear-and-republish state survives command cleanup.
  • Normal maintainer review is complete and approves this exact head.
  • The review's stored-data-model detector is a filename-content classifier false positive. This PR changes process-local plugin metadata snapshot state only; it changes no SQLite schema, migration, persisted config, vector store, or embedding data model.

This resolves all three current Before merge items. The two listed Rank-up moves: are also complete: exact-head CI finished green, and this comment confirms the latest rank-up list has no remaining action.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 4, 2026
@vincentkoc
vincentkoc merged commit c3f148f into main Aug 4, 2026
138 of 143 checks passed
@vincentkoc
vincentkoc deleted the fix/plugin-metadata-snapshot-cas branch August 4, 2026 11:24
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
…tial-gate

* origin/main:
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
vincentkoc added a commit that referenced this pull request Aug 4, 2026
…checkpoint

* origin/main: (46 commits)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  fix(scripts): prevent gateway benchmarks from stalling on probes (#119063)
  test(channels): verify built sanitizer semantics (#119151)
  fix: prevent live updater from leaving Gateway offline indefinitely (#119116)
  test(qa): restore memory tools primary ownership (#119142)
  fix(agents): settle yielded fanout at harness boundary (#118703)
  fix(codex): cap compaction override warning cache via createDedupeCache (#101745)
  fix(daemon): skip unlabeled launchd plists (#119091)
  test(qa): repair QA catalog integrity (#119140)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (208 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
…time

* origin/main: (177 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
…w#119183)

* fix(plugins): preserve newer metadata publications

* test(plugins): type metadata snapshot fixture
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (openclaw#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (openclaw#119218)
  test(qa): cover Canvas agent and node controls (openclaw#119047)
  fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051)
  fix(gateway): keep agents list on prepared model facts (openclaw#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (openclaw#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575)
  fix(agents): recover from invalid compaction summaries (openclaw#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166)
  fix(plugins): preserve metadata reloads during models status (openclaw#119183)
  fix(test): bound direct gateway server runs (openclaw#119184)
  test(tui): prove command surfaces through PTY (openclaw#119165)
  fix(testbox): restore claims across path aliases (openclaw#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (openclaw#119164)
  fix(testbox): remove changed-gate sync residue (openclaw#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (openclaw#118998)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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