Feature hasn't been suggested before.
This recreates #35443, which was automatically closed after 60 days of inactivity.
Describe the enhancement you want to request
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 already covers prompt, command, interrupt, wait, and compact (compact landed in #52385). Two session APIs that already exist elsewhere in opencode are still not available to plugins:
context.session.shell(...)
context.session.active(...)
These are useful for plugins that coordinate work around the current session. For example, a queue plugin may need to run a shell command in session context, or check if the current run is still active before sending the next item (wait covers the blocking case, active covers the pollable check).
Feature hasn't been suggested before.
This recreates #35443, which was automatically closed after 60 days of inactivity.
Describe the enhancement you want to request
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 already covers prompt, command, interrupt, wait, and compact (compact landed in #52385). Two session APIs that already exist elsewhere in opencode are still not available to plugins:
These are useful for plugins that coordinate work around the current session. For example, a queue plugin may need to run a shell command in session context, or check if the current run is still active before sending the next item (wait covers the blocking case, active covers the pollable check).