plugins: Allow trusted plugin keyed state#83775
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source inspection: current main rejects non-bundled PR rating Rank-up moves:
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. PR egg Where did the egg go?
Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Land the runtime gate after aligning the public SDK wording and adding real Slack or trusted global-plugin proof that persistence works while untrusted plugins remain blocked. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main rejects non-bundled Is this the best way to solve the issue? Mostly yes: using the existing Label justifications:
Full review comments:
Overall correctness: patch is correct What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against d124c5aa2005. |


Summary
Fixes #83762.
This PR allows
runtime.state.openKeyedStore()for trusted official plugin installs in addition to bundled plugins. That keeps untrusted global/workspace plugins blocked while letting official externalized channel plugins such as Slack, Discord, Matrix, and MS Teams use their existing host-backed persistent state when installed globally.Root Cause
The plugin runtime proxy only allowed keyed state for records with
origin === "bundled". Official channel plugins can now be loaded as trusted global installs, so their persistent state paths caught the runtime error and degraded to in-memory state.Changes
record.trustedOfficialInstall === true.Validation
pnpm exec vitest run src/plugin-state/plugin-state-store.runtime.test.ts extensions/slack/src/sent-thread-cache.test.ts extensions/discord/src/components.test.ts extensions/matrix/src/approval-reactions.test.ts extensions/msteams/src/sent-message-cache.test.tspnpm test:contracts:pluginspnpm test:contracts:channelspnpm checkcodex review --base origin/main(no findings)AI Assistance
This PR was prepared with Codex assistance. I reviewed the diff and validation results before submission.