Repository navigation
Conversation
A plugin panel currently cannot read any state its own worker computed. workspace.readContext, terminal.sendText and notifications.show are panel-callable; every readable state method (storage.get, settings.get) is panel: false, and there is no host->panel push. A panel can therefore only ever render static markup. This is the narrowest fix that unblocks live panel UI: read-only, plugin-private scope, already gated on the storage capability, and strictly less powerful than terminal.sendText - which panels may already call, and which mutates a terminal. Writes stay worker-only, so a panel can observe state but never author it. Secrets stay entirely worker-only. Adds plugin-panel-storage-read.test.ts covering the new surface plus invariants that should hold regardless: writes and secrets are not panel-callable, every panel-callable method is capability gated, and no panel-callable mutation escapes an explicit scope.
The fixture used storage.get, which this branch makes panel-callable. The case exists to prove main and relay return identical panel_forbidden codes, not to pin that specific method, so it now uses storage.set - a write, still worker-only by design.
📝 WalkthroughWalkthroughThe plugin host API now allows sandboxed panels to call Merge Risk: ⚪ Minimal · up to This narrowly scoped change enables panels to read their plugin’s private state while keeping writes and secrets restricted; no actionable merge-blocking risk remains, aside from a minor follow-up to strengthen transport conformance coverage. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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
🧹 Nitpick comments (1)
src/shared/plugins/plugin-host-api.ts (1)
159-164: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the
storage.getrationale and remove the inaccurate claim.The six-line comment repeats the metadata that follows it. The statement that a panel can “only ever render static markup” is too broad because
workspace.readContext,terminal.sendText, andnotifications.showare already panel-callable. Replace it with one concise sentence that states the non-obvious contract: panels may read plugin-private worker state, while storage writes remain worker-only.Proposed comment
- // Why panel-callable: a panel currently has no way to read ANY state its own worker computed, - // so a plugin panel can only ever render static markup. This is the narrowest possible fix — - // read-only, plugin-private scope, already gated on the `storage` capability, and strictly - // less powerful than `terminal.sendText`, which panels may already call and which mutates a - // terminal. Writes (`storage.set`/`delete`) deliberately stay worker-only, so a panel can - // observe state but never author it. + // Panels may read plugin-private worker state; storage writes remain worker-only.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 905ba6c1-8bb6-4f5f-b91d-6a9ce87556bc
📒 Files selected for processing (3)
src/main/plugins/plugin-host-conformance.test.tssrc/shared/plugins/plugin-host-api.tssrc/shared/plugins/plugin-panel-storage-read.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| it('storage.get is callable from a panel, so a panel can render live state', () => { | ||
| expect(isPluginPanelAction('storage.get')).toBe(true) | ||
| expect(byName('storage.get')?.panel).toBe(true) | ||
| }) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- candidate files ---'
git ls-files | rg 'plugin-panel-storage-read\.test|plugin.*panel|panel.*runtime|capability|storage'
printf '%s\n' '--- test file outline ---'
ast-grep outline src/shared/plugins/plugin-panel-storage-read.test.ts
printf '%s\n' '--- test file ---'
cat -n src/shared/plugins/plugin-panel-storage-read.test.ts
printf '%s\n' '--- relevant symbols ---'
rg -n -S 'isPluginPanelAction|gatePluginHostCall|storage\.get|plugin-private|capability' src test tests 2>/dev/null | head -n 300Repository: stablyai/orca
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- plugin source files ---'
git ls-files 'src/shared/plugins/*' 'src/main/plugins/*' 'src/preload/api/plugin-host-api.ts' | sort
printf '%s\n' '--- API and gate definitions ---'
rg -n -S 'PLUGIN_HOST_API_V0|isPluginPanelAction|gatePluginHostCall|storage\.get|plugin-private|panel' \
src/shared/plugins src/preload/api/plugin-host-api.ts src/main/plugins \
-g '*.ts' -g '*.tsx' | head -n 400
printf '%s\n' '--- candidate test outlines ---'
for f in src/shared/plugins/plugin-panel-call-admission.test.ts \
src/shared/plugins/plugin-panel-bridge.test.ts \
src/shared/plugins/plugin-panel-shell.test.ts \
src/main/plugins/plugin-panel-controller.test.ts \
src/main/plugins/plugin-storage-store.test.ts; do
if [ -f "$f" ]; then
echo "### $f"
ast-grep outline "$f"
fi
doneRepository: stablyai/orca
Length of output: 42166
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- capability gate ---'
cat -n src/shared/plugins/plugin-capability-gate.ts
printf '%s\n' '--- host method dispatch ---'
cat -n src/main/plugins/plugin-host-methods.ts
printf '%s\n' '--- storage binding ---'
sed -n '90,135p' src/main/plugins/plugin-host-method-bindings.ts
printf '%s\n' '--- conformance tests: setup and storage cases ---'
sed -n '1,230p' src/main/plugins/plugin-host-conformance.test.ts
sed -n '300,370p' src/main/plugins/plugin-host-conformance.test.ts
printf '%s\n' '--- service dispatch ---'
sed -n '235,285p' src/main/plugins/plugin-service.ts
printf '%s\n' '--- storage store tests ---'
cat -n src/main/plugins/plugin-storage-store.test.tsRepository: stablyai/orca
Length of output: 24994
🏁 Script executed:
#!/bin/bash
set -e
python3 - <<'PY'
from pathlib import Path
api = Path('src/shared/plugins/plugin-host-api.ts').read_text()
conformance = Path('src/main/plugins/plugin-host-conformance.test.ts').read_text()
gate = Path('src/shared/plugins/plugin-capability-gate.ts').read_text()
checks = {
'storage_get_is_panel_callable_in_api': "'storage.get'" in api and "name: 'storage.get'" in api and "panel: true" in api[api.index("name: 'storage.get'"):api.index("name: 'storage.get'") + 500],
'conformance_sends_each_method_through_both_adapters': "Object.values(createAdapters(resolvePolicy)).map" in conformance,
'conformance_uses_spec_panel_flag': "}, spec.panel)" in conformance,
'conformance_has_storage_get_success_params': "'storage.get': { key: 'alpha' }" in conformance,
'conformance_storage_success_uses_storage_capability': "const policy = createPolicy([spec.capability])" in conformance,
'conformance_has_storage_get_denial_case': "request: { method: 'storage.get'" in conformance and "code: 'capability_denied'" in conformance,
'gate_checks_declared_spec_capability': "subject.grantedCapabilities.includes(spec.capability)" in gate,
}
for name, result in checks.items():
print(f"{name}={result}")
PY
printf '%s\n' '--- exact denial cases ---'
sed -n '165,245p' src/main/plugins/plugin-host-conformance.test.ts
printf '%s\n' '--- API storage spec ---'
sed -n '120,180p' src/shared/plugins/plugin-host-api.ts
printf '%s\n' '--- adapter path ---'
cat -n src/main/plugins/plugin-host-call-adapter.tsRepository: stablyai/orca
Length of output: 7424
Add storage-specific panel conformance cases.
The conformance harness already dispatches storage.get through both transports, but it does not assert the returned plugin-private value or deny a panel call without storage. Seed plugin-private state, assert the panel read result, and assert capability_denied without the grant. Keep the metadata assertions as contract tests.
…2 decisions HANDOFF said M13 was blocked on stablyai/orca#15643. That was wrong: the block is on display, not on control, and control works today via terminal.sendText. Corrected in place rather than quietly, because a future agent reading the old line would schedule behind an upstream PR with no maintainer engagement. Adds the three newer upstream items, records the eight decisions the design round locked, and moves the settled entries out of "Open decisions" into their own section. The one new open decision is the one no single design could see: three documents now write into the same audio stream and none of them summed the total. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JRAHyqLuabxR8qsFguBaHk
|
thanks for reporting. looking into it |
Follows #15638. That issue asked for a host→panel message channel; this is a much smaller change
that solves most of the same problem, so I built it instead.
Problem
A plugin panel cannot read any state its own worker computed.
panel:workspace.readContextterminal.sendTextnotifications.showstorage.get,storage.set,settings.get,settings.set,secrets.*,events.subscribeThere is also no host→panel push. So a panel can only render static markup — whatever the plugin
author hard-coded at build time.
My plugin reads agent replies aloud. Users cannot see what is currently being read, which session
it came from, or what is queued behind it, because the panel has no way to learn any of it. The
real report that prompted this: "this is really confusing what it is even reading right now… a way
to control something and not feel helpless." For an accessibility plugin that is not a cosmetic
gap.
Change
One line:
storage.getbecomespanel: true.The worker writes its status to plugin-private storage; the panel polls and renders it. No new API,
no new capability, no new transport.
Why this is the narrowest possible fix
storage.setandstorage.deletestay worker-only, so a panel can observe statebut never author it.
storage, which the user consents to at install.terminal.sendTextis panel-callableand types into the user's terminal. Reading a plugin's own private key/value store is a smaller
privilege than that, and today the weaker one is the forbidden one.
secrets.*remain entirely worker-only.Tests
New
src/shared/plugins/plugin-panel-storage-read.test.ts— 6 cases. Beyond the new surface itpins invariants that should hold regardless of this PR:
secrets.*are not panel-callableOne existing fixture changed, and I want to flag it explicitly.
plugin-host-conformance.test.tsusedstorage.getas its exemplar of a panel-forbidden method.That case exists to prove main and relay return identical
panel_forbiddencodes, not to pin thatparticular method, so it now uses
storage.set— a write, still forbidden by design. The case stillexercises the same path. If you would rather it used
settings.get, say so and I will switch it.Why other plugin authors want this
Every panel today is a static page. With this, a panel can show progress, a queue, a log tail, a
last-run result, a live status — anything the worker knows. That is the difference between panels
being decorative and being useful.
If you would rather solve it with the push channel from #15638, I am happy to build that instead —
this seemed like the version most likely to be safely mergeable today.