Skip to content

Plugin API: no way for a plugin to reach assistant message text #15637

Open

Description

@YoraiLevi

Hello — I've built a text-to-speech plugin for ORCA
(YoraiLevi/orca-plugin-tts) that reads agent replies
aloud. It works, but it reaches the reply text by a route I don't think you intended, and I'd rather
raise it than quietly depend on it.

Everything below was read at 0f26ff4ad83e9ca736f6ad3bae6937cd0cdab7fc and verified by running a
probe plugin inside a real build, not inferred.

What a plugin can see

agent.status.changed is the only event carrying agent activity, and its payload is a four-field
projection (src/shared/plugins/plugin-events.ts:28-33):

worktreeId: string | null
paneKey:    string
state:      string
receivedAt: number

The strip is deliberate and enforced twice — at the emit site (src/main/index.ts:2906-2911) and
again in PluginEventBus.projectPayload (src/main/plugins/plugin-event-bus.ts:33-41), which
zod-parses and returns parsed.data. The file header says why: "Payloads are bounded projections —
never raw runtime objects — so nothing sensitive … can leak through the event stream."

That is a sound default and I'm not asking you to remove it.

What ORCA already has

Internally there is exactly the model a TTS plugin wants — NativeChatMessage with typed
text / tool-call / tool-result blocks, raw markdown, live-tailed with a 40 ms debounce
(src/shared/native-chat-types.ts:31-80). It is renderer-facing IPC only.

AgentStatusEntry.lastCompletedAssistantMessage (src/shared/agent-status-types.ts:131-134) is
almost precisely the field such a plugin needs, and it is not plugin-visible.

What the plugin does instead

Because the worker is a plain forked Node process with execArgv: [] and no permission model, it
can — and mine does — tail ~/.claude/projects/**/*.jsonl itself and re-implement your transcript
decoders, since those live in src/main and aren't shipped to plugins.

I want to be straightforward that this is outside your seven-capability model
(src/shared/plugins/plugin-capabilities.ts:15-23 has no filesystem capability), even though
nothing blocks it today. The header there names net:fetch and process:exec as future scoped
capabilities, which reads to me like the worker is meant to be confined eventually — at which point
every plugin doing this breaks at once.

There is also a correctness cost: I re-parse a format you already parse, so my copy rots
independently of yours.

What would help

Some plugin-visible route to assistant text. Options, roughly in increasing size:

  1. A chat:read capability gating a host method that returns recent NativeChatMessages for a
    pane — reusing the existing model, consented explicitly like every other capability.
  2. An agent.message event carrying the completed assistant turn, gated on a capability.
  3. A field on the existing projection (see the sibling issue about sessionId) that at least
    lets a plugin find the right transcript deterministically.

Any of these turns "plugin reads your users' transcript files directly" into "plugin asks for a
consented capability", which seems better for both of us.

Why other plugin authors benefit

Anything reacting to what an agent said rather than merely that it changed state needs this:
summarizers, notification routers, changelog builders, dictation round-trips, accessibility tools.
Today each one either re-implements transcript parsing or cannot exist.

For context on the last of those: I'm building this because I'm dyslexic and work voice-first.
ORCA already ships a genuinely good speech-input stack (src/main/speech/, dictation, Mod+E).
Speech output is the missing half, and the plugin API is currently the wrong shape to add it from
the outside.

Happy to send a PR for whichever direction you prefer — I didn't want to guess and hand you an
unwanted design. Thanks for building ORCA.

Activity

  1. YoraiLevi commented on Aug 20, 2026

    @YoraiLevi
    Author

    Small update: I shipped the plugin this issue came from (YoraiLevi/orca-plugin-tts), and it works — a user is hearing agent replies read aloud in a real session today.

    It gets the text by having its worker tail ~/.claude/projects/**/*.jsonl and re-implement your Claude decoder, exactly the route described above. Two things that fell out of real use, in case they inform the design:

    1. The done edge is not the right signal. agent.status.changed fires before the agent CLI flushes its final message, so reading "the newest reply" at done reliably returns the previous turn. I had to watch the transcript file instead and treat the event as a hint. A chat:read capability or an agent.message event would not have this problem, since the host already knows when a message is complete.

    2. Thinking blocks are the sharp edge. Filtering has to happen at the raw record level — once thinking is flattened into text blocks the distinction is unrecoverable, and speaking a model's reasoning aloud is a genuine privacy surprise. Any future API here should keep the block types intact rather than pre-flattening.

    Still happy to send a PR for whichever direction you prefer.

  2. added
    bug
    on Sep 19, 2026
  3. added theissue type on Sep 19, 2026
  4. Hector1567XD commented on Nov 8, 2026

    @Hector1567XD

    Same need here, from a plugin we're planning.

    We want to mirror agent status into a team app with agent:read only, and no terminal:* capabilities. Status works through agents.list / agent.status.changed. But showing the conversation, or letting the person answer an agent's question, has no supported route: the plugin would need either read access to assistant messages or Orca's orchestration messaging (inbox / reply / gates) exposed as a capability.

    Something like a read-only capability for assistant text, plus an opt-in capability that sends through Orca's messaging instead of raw terminal.sendText, would let plugins like ours stay off the terminal entirely.

  5. jacob-huang commented on Nov 17, 2026

    @jacob-huang

    +1 from another spoken-alerts plugin, with one data point this issue doesn't cover yet.

    Earlier builds wrote agent-hooks/last-status.json on each status change, so a plugin could read the main agent's lastAssistantMessage when agent.status.changed fired. In 1.4.261 that moved to last-status.db (SQLite), which is committed in batches roughly every 3 minutes, so at the moment the event fires it usually still holds the previous state. That removes the last route short of parsing each agent's transcript files directly, which this issue already explains is the outcome nobody wants.

    Option 1 or 2 above would solve it for us too. Even a minimal version would cover notification plugins: the main agent's last completed assistant message (no tool output) and its pending question or tool name, on a capability-gated event or host call.

  6. Shark-777 commented on Nov 28, 2026

    @Shark-777

    We built a macOS Voice Reader prototype with a sidebar, status bar controls, and pause/resume and stop. It can read pasted or explicitly copied text, including Russian text with the Svetlana voice. This lets it work across chat providers without parsing their transcripts, but still leaves a manual copy step.

    A user-invoked Read aloud action on a completed reply would cover that use case directly. A consent-gated plugin API for the visible text of the selected reply, with thinking blocks excluded, would also let plugins provide the action. We'd be happy to share a standalone plugin for testing if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggit

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions