Repository navigation
Conversation
Sandboxed panels have no data path: the panel shell CSP blocks fetch, and workers cannot push to panels — so a worker that prepares display data cannot hand it to its own panel without rewriting the panel entry on disk, which defeats content hashing for installed plugins. Mark the two non-mutating plugin-private storage reads (storage.get, storage.keys) panel-callable. The panel action surface derives from the spec table, so the bridge, gate, and relay pick this up unchanged. Mutating storage methods and all secrets methods stay worker-only, now locked by a conformance test. Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe plugin host now allows panels to call the read-only 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c5a5242a-c6b8-4738-9b2f-1ef618ac9016
📒 Files selected for processing (2)
src/main/plugins/plugin-host-conformance.test.tssrc/shared/plugins/plugin-host-api.ts
Per review: fresh service mocks for each transport so desktop-main and relay are each verified to hit storage.get/storage.keys exactly once with the bound plugin key, instead of one aggregate assertion. Co-Authored-By: Claude Fable 5 <[email protected]>
Allow sandboxed panels to read their plugin's own storage
User-visible change
Plugin panels can now call
storage.getandstorage.keysover the panelbridge (previously worker-only). This gives panels their first data path:
a plugin worker can prepare display data in its own storage and the panel can
read it live, instead of the only current workaround — regenerating the panel
entry HTML on disk, which defeats content hashing for installed plugins and
only refreshes on remount.
No visual change. No new UI; existing panels behave identically unless
their plugin starts using the new actions.
Why this shape
connect-src 'none'by design, and workers cannotpush to panels — so today a panel literally cannot display live data
through any supported channel.
storage.get/storage.keysare the two non-mutating,plugin-privatescoped methods of the already-consented
storagecapability. Reading yourown plugin's storage from your own plugin's panel crosses no trust
boundary that the worker hasn't already crossed.
derive from the spec table, so the change is two
panel:flags; everyenforcement point picks it up consistently (covered by the conformance
suite on both desktop-main and relay transports).
What stays locked down
storage.set/storage.deleteremain worker-only (a new conformancecase uses
storage.setvia panel as the canonicalpanel_forbiddenexample).
secrets.*methods remain worker-only — a new invariant test assertsno secrets method and no mutating plugin-private method is ever
panel-callable, so this can't regress silently.
storagegetscapability_denied.Motivating use case
A read-only Hermes Kanban board panel (AVAS): a trusted worker polls a local
read-only API and maintains a snapshot; the sidebar panel needs to render it
live. Today this requires rewriting
panel/index.htmlevery poll cycle —works only for dev plugins (hash-exempt) and refreshes only on remount. With
this change the worker writes to storage and the panel polls
storage.getwithin the existing budgets.
Tests
storage.get/storage.keyson bothtransports;
storage.setandsecrets.getvia panel remainpanel_forbidden; exact panel action surface asserted.pnpm lint,pnpm typecheck, and the plugin suites(
src/shared/plugins/,src/main/plugins/, renderer panel bridge host)pass.
AI code review summary
Reviewed by the authoring agent for: cross-platform impact (none — shared,
Electron-free spec table; no platform-conditional code), SSH/remote/local
compatibility (relay conformance path exercises the same gate; results are
plain JSON over the existing panel action reply channel; no new wire opcode,
additive within the existing method call shape), agent/integration
compatibility (no agent-facing surface touched), performance (no hot-path
work added; panel calls remain budgeted), UI (no visual change), security
(read-only, plugin-private, capability-gated expansion; secrets and
mutations remain worker-only and are now invariant-tested). One note for
maintainers: storage values can be up to 256KB while panel → host request
budgets are 64KB; results flow on the reply channel like existing action
results, but if you prefer a result-size clamp for panel-path reads we're
happy to add one.
Platform/remote notes
Behavior is identical across macOS/Linux/Windows and desktop/serve/relay —
enforced by the shared spec table and the conformance suite.