Expose plugin-initiated detached sessions on ExtensionActions (it already works via DaemonClient) #1488
jasoncarreira
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
An extension can already start a detached session and prompt it without blocking its own turn — by importing
DaemonClientfrom the package and speaking the daemon protocol. It just is not part of the extension API or thedocumentation, so it reads as unsupported. I would like it exposed on
ExtensionActions(or documented as asupported path), because it is the one capability our opencode plugin has that our prime extension cannot offer.
Environment. prime-agent 0.7.2, daemon protocol 7 (
protocol-7-schema-16-1bcb9e7f1a49), build83a0f9f-dirty, Node 24.11.1, macOS 15 (darwin 25.5.0).What works today
Result:
promptreturnssuccess: trueimmediately, the session runs on its own,prime-agent listshows it(
lifecycle: live), andprime-agent stop d7190de5f08areturnsok. Everything a caller needs is already there.What is missing
ExtensionActionshas 14 members —sendMessage,sendUserMessage,appendEntry,setSessionName,getSessionName,setLabel,getActiveTools,getAllTools,setActiveTools,refreshTools,getCommands,setModel,getThinkingLevel,setThinkingLevel— and every one acts on the extension's own current session.There is no way to start another one, so an extension that wants to dispatch background work has to reach around
its own API into
DaemonClient, with no guarantee that remains supported.A small addition would cover it, for example:
Why it matters to us
We ship the same build-orchestration tool as an opencode plugin and as a prime extension. The opencode plugin
offers a background mode because its plugin API exposes session creation and an async prompt; our prime
extension is foreground-only for exactly the missing piece above. Making it a supported extension capability
would let the two adapters offer the same surface.
Not verified
I confirmed the sequence from an ordinary Node import against a live daemon, not from inside a loaded extension —
so I have shown the daemon accepts it, not that the extension runtime permits it. If that distinction matters,
I can test it inside a real extension.
All reactions