Repository navigation
Description
Related to #15637, but a separate and much smaller ask.
While building a TTS plugin (YoraiLevi/orca-plugin-tts)
I probed what a plugin panel can actually do with audio, inside a real build at
0f26ff4ad83e9ca736f6ad3bae6937cd0cdab7fc. The result surprised me and might interest you.
The panel is a better audio host than I expected
Measured in a real sandboxed panel, opaque origin, under the unmodified PLUGIN_PANEL_CSP
(src/shared/plugins/plugin-panel-shell.ts:20-22):
| Probe | Result |
|---|---|
window.speechSynthesis |
works — 180 voices, start → boundary → end fires |
AudioContext |
constructs in state running, no user gesture needed |
AudioBufferSourceNode from a Float32Array |
plays; 4 ms scheduling drift over chained buffers |
source.stop() → onended |
2 ms |
decodeAudioData on MP3 / Opus / AAC / WAV |
all decode, 8–10 ms for ~1.5 s of audio |
| CSP violations across the whole run | zero |
The reason default-src 'none' doesn't block any of this is that CSP governs resource loads. An
AudioBuffer filled from a typed array involves no URL, no fetch and no src. (For contrast:
<audio> with a data: or blob: src is blocked — media-src, MediaError.code 4 — as you'd
expect.)
AudioWorklet.addModule() is also blocked for both blob: and data: URLs, since that's a script
fetch. AudioBufferSourceNode scheduling is enough, so this isn't a problem.
The gap
There is no way to get audio to the panel.
- The panel bridge is panel→host only; there is no host→panel push.
commands.invoke,storage.get,events.subscribefrom a panel all return
"action: not a panel-callable action".connect-src 'none'means the panel can't fetch anything itself.
So the panel is an excellent speaker with no wire to it, and the plugin worker — which has the text
— has no audio device. My plugin currently writes a WAV to a temp file and spawns afplay /
paplay / PowerShell per chunk, which costs roughly a second of silence between sentences.
The ask
One host→panel message channel. Something like panel.postMessage(panelId, data) from the
worker, delivered to the panel's existing bridge listener.
Some measurements to size it: the panel→host direction caps at 64 KB per message and 30 messages per
10 s (plugin-panel-bridge.ts:23), which is ~1.9 MB / 10 s. 22 kHz mono Int16 PCM is 44 KB/s —
about one message per second. Bandwidth isn't the constraint; the absence of the channel is.
Why other plugin authors benefit
Any plugin whose panel needs data the worker computed is stuck the same way: live charts, log
viewers, progress UIs, previews, anything streaming. Right now a panel can only display what it can
derive on its own, which is a fairly narrow set of plugins.
For audio specifically, this one channel would replace the temp-file-and-subprocess dance with
sample-accurate scheduling and a 2 ms stop — better latency, no spawned processes, no platform-specific
player detection, and it works identically on macOS, Linux and Windows.
Happy to send a PR if you'd tell me the shape you'd accept — whether you'd want it capability-gated,
and whether the same 64 KB / rate limit should apply in this direction.
Activity
YoraiLevi commentedon Aug 20, 2026
Update from using this in anger.
A user running the plugin hit exactly the failure this gap causes, and it is worse than
"panels are a bit limited". Their words:
The plugin reads agent replies aloud. With no way to show what is playing, which session it came
from, or what is queued, the user has no model of what the plugin is doing — and for an
accessibility tool that is a real harm, not a cosmetic gap.
I have opened #15643, which is a much smaller change than the push channel proposed here: make
storage.getpanel-callable. The worker writes status to plugin-private storage and the panel pollsit. Read-only, plugin-private, already gated on the
storagecapability, and strictly less powerfulthan
terminal.sendText— which panels may already call, and which types into a terminal.That would unblock live panel UI today without a new transport. This issue is still worth doing on
its own merits — polling is not push, and audio streaming to a panel genuinely needs the channel
(the measurements above show panel playback is excellent once data can reach it). But if only one
of the two lands, #15643 is the one that changes what plugin authors can build.
torohima commentedon Aug 23, 2026
Independent confirmation from a different plugin, plus what the workaround actually costs
Hit the same wall from an unrelated direction — a status panel that renders data collected by an external process — and measured 1.4.187's bundle before finding this issue. Everything here agrees with your report, so this is a second data point rather than a second opinion.
What the bundle says:
PLUGIN_PANEL_CSPis a literal constant, interpolated once into the panel shell's<meta http-equiv="Content-Security-Policy">. Nothing conditional reads it — no setting, no dev-mode flag.connect-srcstring, that constant. There is no relaxed policy to switch to, which I think is worth stating explicitly: this is a closed door by design, not a missing config..strict()-validated, so an unknown kind is rejected rather than ignored:["workspace:read","terminal:send","notifications:show","storage","secrets","events:subscribe","settings:own"]. No network kind.entryis a contained relative file path, so pointing a panel at a local http URL is not a way around it either.The workaround, and why it is worse than it looks. With no host→panel channel, the only writable surface is the panel's own HTML, which the host re-reads on every mount. So an external writer rewrites the generated panel file and the panel renders an embedded, timestamped snapshot. Two defects came free with that shape, and both took real debugging to attribute:
os.replace.Neither is Orca's bug. They are the cost of emulating a data channel with a file, and every plugin that needs the same thing will pay them again — differently, and probably later.
On the two proposals. They solve different halves and I would take either, in this order:
panel.postMessage(this issue) is the general fix — it covers streaming and event-driven cases like yours, where the panel must react rather than poll.storage.get(Allow sandboxed panels to read their plugin's own storage (storage.get/storage.keys) #13220 / feat(plugins): allow panels to read plugin storage (storage.get panel: true) #14766) already covers the read-a-snapshot case, which I suspect is the common one: a worker computes state, the panel renders it. Allow sandboxed panels to read their plugin's own storage (storage.get/storage.keys) #13220's own description names the exact workaround above — "previously this required rewriting panel/index.html every cycle, functioning only for development plugins" — so at least three plugins have now independently arrived at the same hack.Happy to test either against a real panel and report back.
harepus commentedon Sep 29, 2026
@AmethystLiang Another data point: we want a multi-agent launcher and live dashboard (batch-launch agents into one grid, see who needs you, jump to the pane). Honestly we'd rather see that native in Orca, maybe as an extension of the experimental Agent Dashboard, than as a plugin. The plugin is a stopgap, and it runs into this issue: we ended up with the same rewrite-the-panel-HTML hack described above.
#12229 (
plugin.command.invoke, bound to the panel's own plugin) would cover both halves for us: panel actions with args, and polling worker state. Is that a shape you'd accept, or are you leaning toward push orstorage.get?ZephyrDeng commentedon Sep 29, 2026
Additional reproduction from a live task-board plugin on Orca 1.4.215 (build commit
3eb1adec20ff90503196ebfd1fe6dbaaefaad736). This is the same missing worker-to-panel data channel, beyond the audio use case.documentRevision. The iframe key includes that revision and itssrcDocchanges, so the document is recreated rather than receiving an incremental data update.We fixed spurious writes by comparing snapshots canonically and ignoring collection timestamps. An unchanged-data live check passed across multiple polling intervals, but real data changes still recreate the iframe. Deduplication therefore only removes unnecessary refreshes; it does not solve live updates. We have temporarily disabled the board pending a supported channel.
The installed host API marks
storage.get/storage.keysaspanel: false; the bridge validates requests against the panel-callable action set. A worker-to-existing-panel push channel, or panel access to its own plugin-private snapshot, would let us update the existing DOM without rewriting the document. Invoking the panel's own worker command could also provide a pull path.Tracking the related proposals: #15643, #13220 (private storage reads), and #12229 (own-worker command invocation). Merge/issue status alone will not establish availability in an installed build.
Acceptance for restoring the board: real task, message and ledger changes arrive without reloading the document; the iframe and unchanged DOM nodes retain identity; expanded state, focus and scroll position survive. We will still need to implement and test incremental DOM updates after the transport exists.
This report deliberately uses no real task contents, local paths or embedded snapshots.
psoto commentedon Sep 30, 2026
Adding a concrete use case for a worker → panel data channel.
Our team keeps two repo-versioned plugins that are monitoring dashboards: a deploy-pipeline view and a shared dev-box monitor (instance state, per-user sessions and agents, CPU/RAM/disk). Both collect data in the worker by shelling out to CLIs with the user's own auth, and both would naturally live in a right-sidebar panel with an icon. Today they render a temp HTML file and open it in Orca's browser instead, because:
PLUGIN_PANEL_CSPblocks every load the panel could use (connect-src 'none',img-src data:).workspace.readContext,terminal.sendTextandnotifications.show, so the panel cannot read anything the worker produces.The smallest change that would unblock this pattern: make a read-only
storage.get(plugin-private scope) panel-callable. The worker writes a JSON snapshot withstorage.setand the panel pollsstorage.getover the existing bridge, well inside the 30 messages per 10 s budget. A push variant (a worker → panel message, or astorage.changedevent delivered to the panel) would avoid polling, but read-only access alone is enough. This overlaps with item 2 of #19020.marioser commentedon Oct 4, 2026
Another use case for a worker→panel channel, independent of audio.
I'm building a plugin that tracks the prompt-cache lifetime of every agent session (Claude
Code, Codex, OpenCode, Pi) by reading each agent's own session logs from the worker, and
warns before the cache expires. The natural UI is a panel with one row per session and a
live countdown. Today the plugin can only fall back to
notifications.showplus a palettecommand, because:
workspace.readContext,terminal.sendTextand
notifications.showas the only panel-callable actions;storage;connect-src 'none'rules out any side channel.Either shape from this issue would unblock it:
its result (pull, polled every few seconds), or
panel.post({ panelId, data })).For this case (1) is enough and keeps the bridge request/response only. A small bounded
payload (a few KB of JSON) every ~5 s would cover it.
Two related gaps I hit while designing it, in case they belong elsewhere:
workspace.readContext, which carries no path;agent.status.changedcarries no agent type or session id, so a plugin cannot tie astatus change to a specific agent session without guessing.
mmarabel commentedon Oct 30, 2026
Another use case for this channel: a fleet-monitoring plugin that shows CPU and memory for connected machines in a sidebar panel. The worker would collect the readings; the panel needs a supported way to receive them and refresh its display. A same-plugin request/response API such as #25256 would be enough for periodic updates; GPU readings could be added where available.
nwparker commentedon Nov 7, 2026
Thanks for the detailed measurements, they were really useful. #37013 (merged) adds the host-to-panel channel you asked for: the worker calls
orca.panels.post(event, payload, { panel? })and the panel listens withplugin.on(event, fn)(window.orca.pluginin HTML panels). Posts can be up to 256 KiB, at most 200 per 10 s per plugin, which is plenty for 22 kHz PCM chunks. The panel can also call the worker withplugin.request(name, input)/orca.panels.handle(name). Docs: plugin-authoring.md and plugin-host-api.md; example: examples/plugins/hello-worker-panel. Closing as fixed. If something is missing for the TTS plugin, please open a new issue.