Skip to content

fix(channels): reset metadata ownership across lifecycle changes - #117005

Merged
steipete merged 1 commit into
mainfrom
codex/qa300-channel-metadata-lifecycle-owner
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa300-channel-metadata-lifecycle-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin installation, update, and explicit metadata lifecycle resets left multiple channel process-local caches stale: newly created official or external channel catalogs stayed invisible, bundled channel labels/generated catalogs kept old values, and a previously unavailable inbound attachment contract remained disabled.

Why This Change Was Made

The repository already owns one explicit plugin metadata lifecycle for installation/index changes and runtime resets. This change wires each of the three existing private memo owners into that same lifecycle, clearing only its own maps while retaining steady-state memoization, channel trust filtering, catalog precedence, and narrow media artifact loading.

User Impact

  1. Channel catalogs reflect installed/updated official, external, bundled package and generated metadata after authorized plugin lifecycle changes.
  2. Newly installed channel attachment contracts enable inbound roots after the existing lifecycle reset instead of remaining permanently negatively cached.

Evidence

  • Frozen baseline 36b80ada3ceae2de21b3d8710b883d778e4c4578; immutable reviewed candidate 8286acf7a698d57712095c0b9c91a41f6652e282.
  • Real baseline failures reproduced official/external missing-to-installed metadata and bundled package old-to-new metadata.
  • Exact committed-head five-owner/sibling command:
PATH=/Users/steipete/.local/bin:$PATH node scripts/run-vitest.mjs src/channels/plugins/catalog.test.ts src/channels/bundled-channel-catalog-read.test.ts src/media/channel-inbound-roots.fast-path.test.ts src/channels/plugins/read-only.test.ts src/plugins/plugin-registry-snapshot.lifecycle.test.ts
  • 48/48 passed across three Vitest shards (five media, one plugin snapshot lifecycle, 42 channel owner/sibling tests).
  • Remote-proof availability caveat: two separate fresh Blacksmith leases (tbx_01kywrh2p1gzx1ptykxfajj4xz, tbx_01kywrj6rkz98k6y1s3c67842e) shut down before accepting the command; both were independently status-verified completed. Repository policy explicitly permits trusted-source local fallback when the remote backend is unavailable, so no hosted remote proof is claimed.
  • Genuine full-branch canonical structured autoreview (gpt-5.6-sol, high, P3) found zero P0/P1/P2/P3, confidence 0.91, TruffleHog clean.
  • A separate channel-owner agent independently reviewed all owners, callers, lifecycle, import cycles, trust/exclusion policy, hot paths and final proof.
  • Production delta +17 owner-local registration lines, necessary for three independent map owners; no oversized/suppressed bundled loader, polling, configuration, auth policy, public SDK, protocol, persistence, or dependency changes.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 3:13 PM ET / 19:13 UTC.

ClawSweeper review

What this changes

The PR makes three channel metadata and inbound-media memo caches clear when the plugin metadata lifecycle is reset, with focused regression tests for refreshed catalogs and media contracts.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this draft open for protected maintainer handling. The added catalog and media-cache hooks follow the existing lifecycle pattern, but the same reset still leaves the derived runtime channel-ID memo stale, so a catalog-only channel can remain unrecognized after install or update until process restart.

Priority: P2
Reviewed head: 8286acf7a698d57712095c0b9c91a41f6652e282

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused cache-owner approach is promising, but the uncovered derived memo and mock-only proof keep this PR below merge-ready quality.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused Vitest results, but it provides no inspectable after-fix terminal output, runtime log, recording, or artifact demonstrating the lifecycle change in a real setup; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused Vitest results, but it provides no inspectable after-fix terminal output, runtime log, recording, or artifact demonstrating the lifecycle change in a real setup; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Current derived cache remains outside lifecycle: normalizeChatChannelId lazily memoizes catalog-derived IDs and aliases in runtimeBundledChatChannelEntries; it has no lifecycle clear hook, so a lookup before installation preserves the old fallback catalog after the proposed reset.
Existing reset is the authoritative lifecycle boundary: The runtime reset calls clearPluginMetadataLifecycleCaches, and plugin metadata notifications use the same function before refresh, making it the correct owner boundary for every process-local cache derived from the catalog.
Feature-history provenance: Blame and history attribute the present lifecycle and channel-cache surfaces to commit 642ded397bc1b8ffb89543728c79d109b7c8cdc6, which is the strongest locally available ownership signal for the current implementation.
Findings 1 actionable finding [P2] Clear the derived runtime channel-ID memo
Security None None.

How this fits together

Plugin installation and metadata-change notifications clear shared plugin metadata state before channel setup, routing, and media helpers consult channel metadata. The changed caches turn package manifests and lightweight media artifacts into channel catalogs, IDs, labels, and inbound attachment roots.

flowchart LR
  A[Plugin install or metadata change] --> B[Plugin metadata lifecycle reset]
  B --> C[Channel catalog memo caches]
  B --> D[Inbound media-contract memo]
  C --> E[Channel setup and catalog lookup]
  C --> F[Runtime channel ID and alias memo]
  D --> G[Attachment-root resolution]
  F --> H[Channel routing and normalization]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused Vitest results, but it provides no inspectable after-fix terminal output, runtime log, recording, or artifact demonstrating the lifecycle change in a real setup; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Clear the derived runtime channel-ID memo (P2) - Register runtimeBundledChatChannelEntries with the same metadata lifecycle reset. It is populated from listBundledChannelCatalogEntries() and is not cleared by this patch, so an ID or alias checked before install remains absent after the new catalog cache reset; catalog-only channels still require a restart to normalize. Add the missing-to-installed regression path.
  • Resolve merge risk (P1) - The proposed lifecycle reset refreshes the direct catalog maps but not the existing catalog-derived runtime channel-ID/alias memo, leaving a post-install/update routing path stale until restart.
  • Resolve merge risk (P1) - Direct retrieval of the PR head blobs and merge diff was unavailable during review because the checkout's promisor remote could not resolve GitHub; refresh exact-head review once connectivity returns.
  • Complete next step (P2) - The concrete cache repair is clear, but the maintainer label is protected and the exact PR head could not be fully retrieved for a safe automated repair verdict.

Findings

  • [P2] Clear the derived runtime channel-ID memo — src/channels/plugins/catalog.ts:121-123
Agent review details

Security

None.

PR surface

Source +17, Tests +136. Total +153 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 17 0 +17
Tests 3 137 1 +136
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 154 1 +153

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/channels/plugins/catalog.test.ts, vector/embedding metadata: src/channels/bundled-channel-catalog-read.test.ts, vector/embedding metadata: src/channels/bundled-channel-catalog-read.ts, vector/embedding metadata: src/channels/plugins/catalog.test.ts, vector/embedding metadata: src/channels/plugins/catalog.ts, vector/embedding metadata: src/media/channel-inbound-roots.fast-path.test.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Make every process-local memo that derives runtime channel metadata participate in the same lifecycle reset, including runtimeBundledChatChannelEntries, then add a missing-to-installed ID/alias regression test and attach redacted before/after runtime proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Make every process-local memo that derives runtime channel metadata participate in the same lifecycle reset, including runtimeBundledChatChannelEntries, then add a missing-to-installed ID/alias regression test and attach redacted before/after runtime proof.

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

Yes, from source: normalize an absent catalog-only channel to populate runtimeBundledChatChannelEntries, install or expose that channel, call the metadata lifecycle reset, and normalize again. The cache in src/channels/ids.ts persists because it is not registered with that reset.

Is this the best way to solve the issue?

No. Registering the three direct cache owners is consistent with the existing design, but it is incomplete while the catalog-derived runtime ID/alias memo survives the same lifecycle change.

Full review comments:

  • [P2] Clear the derived runtime channel-ID memo — src/channels/plugins/catalog.ts:121-123
    Register runtimeBundledChatChannelEntries with the same metadata lifecycle reset. It is populated from listBundledChannelCatalogEntries() and is not cleared by this patch, so an ID or alias checked before install remains absent after the new catalog cache reset; catalog-only channels still require a restart to normalize. Add the missing-to-installed regression path.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: A lifecycle reset can leave a newly installed catalog-only channel unavailable to normal ID and alias resolution, but the blast radius is limited to the affected dynamic-channel path.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused Vitest results, but it provides no inspectable after-fix terminal output, runtime log, recording, or artifact demonstrating the lifecycle change in a real setup; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: A lifecycle reset can leave a newly installed catalog-only channel unavailable to normal ID and alias resolution, but the blast radius is limited to the affected dynamic-channel path.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused Vitest results, but it provides no inspectable after-fix terminal output, runtime log, recording, or artifact demonstrating the lifecycle change in a real setup; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current derived cache remains outside lifecycle: normalizeChatChannelId lazily memoizes catalog-derived IDs and aliases in runtimeBundledChatChannelEntries; it has no lifecycle clear hook, so a lookup before installation preserves the old fallback catalog after the proposed reset. (src/channels/ids.ts:61, 642ded397bc1)
  • Existing reset is the authoritative lifecycle boundary: The runtime reset calls clearPluginMetadataLifecycleCaches, and plugin metadata notifications use the same function before refresh, making it the correct owner boundary for every process-local cache derived from the catalog. (src/plugins/runtime.ts:472, 642ded397bc1)
  • Feature-history provenance: Blame and history attribute the present lifecycle and channel-cache surfaces to commit 642ded397bc1b8ffb89543728c79d109b7c8cdc6, which is the strongest locally available ownership signal for the current implementation. (src/plugins/plugin-metadata-lifecycle.ts:1, 642ded397bc1)
  • Direct PR-object inspection gap: The current checkout could inspect main and the supplied PR patch context, but promisor-object reads for the exact PR blobs and full merge diff failed because the GitHub host was unreachable. The finding is based on the supplied changed-line context plus current-main owner and caller evidence.

Likely related people:

  • Vincent Koc: Current blame and path history place the plugin metadata lifecycle, catalog readers, and media-contract cache on the same recent commit. (role: feature introducer and recent area contributor; confidence: high; commits: 642ded397bc1; files: src/plugins/plugin-metadata-lifecycle.ts, src/channels/plugins/catalog.ts, src/channels/bundled-channel-catalog-read.ts)

Rank-up moves

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

  • Register and test lifecycle clearing for runtimeBundledChatChannelEntries.
  • Add redacted terminal or runtime-log evidence showing a channel is unavailable before installation and recognized after the lifecycle reset.

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.

@steipete
steipete marked this pull request as ready for review July 31, 2026 19:26
@steipete
steipete merged commit 8b5871e into main Jul 31, 2026
187 of 191 checks passed
@steipete
steipete deleted the codex/qa300-channel-metadata-lifecycle-owner branch July 31, 2026 19:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 31, 2026
* origin/main: (22 commits)
  fix(cron): preserve lazy ownership and bounded notification lifetimes (#117018)
  fix: live updater no-op restarts healthy gateways (#117038)
  fix(bedrock): release streaming clients (#117039)
  fix(google): restore canonical Gemini and Vertex provider invariants (#117042)
  fix(channels): preserve accepted LINE and Mattermost delivery (#117024)
  fix(feishu): unify truthful delivery and media ownership (#117023)
  fix(ui): isolate gateway observer lifecycles (#117017)
  fix(tui): keep reset transitions isolated from stale input (#116873)
  fix(gateway): centralize streamed media descriptor ownership (#117000)
  feat(plugins): externalize OpenCode provider (#117035)
  fix(onboarding): restore skill dependency consent (#116644)
  fix(streaming): preserve incomplete bracket tails in final replies (#116983)
  fix: allow slower gateway readiness after updates (#117032)
  fix(plugin-state): avoid shared SQLite corruption when CLI starts during gateway runtime (#113204)
  fix(cli): keep config file output raw under JSON logging (#116968)
  fix(ai): malformed Anthropic stream frames expose raw event payloads (#116938)
  fix(qa): authenticate actual scenario execution evidence (#117004)
  feat(plugins): externalize NovitaAI provider (#117007)
  fix(text): preserve fenced tool markers in visible-text sanitizer (#116939) (#116971)
  fix(channels): reset metadata memos with plugin lifecycle (#117005)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant