Skip to content

[FEATURE]: expose more v2 session APIs to plugins #47229

Description

@mirsella

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).

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions