You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: expose more v2 session APIs to plugins #35443
While porting a plugin from the v1 plugin API to the v2 plugin API, I ran into a small gap in the public session runtime.
The v2 plugin context exposes prompt, command, and interrupt, but a few session APIs already exist elsewhere in opencode and are not available to plugins:
These are useful for plugins that coordinate work around the current session. For example, a queue plugin may need to send a prompt, run a slash command, run a shell command, compact the session, or wait until the current run is idle before sending the next item.
Without these APIs, plugins have to drop features that worked in v1, rely on private APIs, or rebuild session state by watching events.
This is not a request for native queue behavior. That is already covered in #5408 and #32157. This is just the smaller API gap: make the existing session operations available through the public v2 plugin context.
This issue might be a duplicate of or closely related to an existing issue. Please check:
v2: internal tool plugins expose gaps in the public plugin API #34957: "v2: internal tool plugins expose gaps in the public plugin API" — this issue also discusses the gap between PluginRuntime.Service (which exposes session.{get,create,messages,prompt,resume,interrupt,synthetic}, job.{start,wait,block,background,cancel}) and the public ctx.session domain, noting that capabilities needed to coordinate work around a session live on the internal service rather than the public plugin context.
This issue is only about exposing four existing session methods to external v2 plugins: shell, compact, wait, and active. If maintainers want all public PluginRuntime gaps tracked in #34957, I am fine closing this as a duplicate.
Activity
github-actions commentedon Jul 5, 2026
This issue might be a duplicate of or closely related to an existing issue. Please check:
PluginRuntime.Service(which exposessession.{get,create,messages,prompt,resume,interrupt,synthetic},job.{start,wait,block,background,cancel}) and the publicctx.sessiondomain, noting that capabilities needed to coordinate work around a session live on the internal service rather than the public plugin context.mirsella commentedon Jul 5, 2026
#34957 is related, but broader.
This issue is only about exposing four existing session methods to external v2 plugins:
shell,compact,wait, andactive. If maintainers want all public PluginRuntime gaps tracked in #34957, I am fine closing this as a duplicate.github-actions commentedon Sep 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.