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]: Plugin API: list sessions and child sessions by parent ID #57212
A plugin cannot list sessions. A plugin cannot list the child sessions of a session. The plugin session API has no list operation.
Source (v2.0.31)
packages/plugin/src/promise/session.ts:153 selects the host operations for plugins:
export type SessionDomain = Pick<
The selection lists create, get, remove, switchAgent, switchModel, prompt, generate, command, compact, synthetic, interrupt, update, move, wait, and context. It has no list.
packages/client/src/effect/api/api.ts:124 shows that the host list operation accepts a parent filter:
readonly parentID?: Session.ID | null | undefined
Purpose
A plugin sends a message to all child sessions of a session. The plugin must know the child session ids. Today the plugin records each child id when it makes the child. The plugin cannot find a child that a different component made.
Proposed minimal API
Add list to the plugin session domain. Give the current SessionListInput through. A plugin then calls ctx.session.list({ parentID }).
What the plugin does today without it
The plugin keeps its own map from parent id to child ids. The map is not complete after a restart, and after a different component makes a child.
Thanks for the detailed write-up! I think this is a duplicate of #43517, which asks for the same ctx.session.list({ parentID, ... }) access for v2 plugins, for the same reason: finding child sessions again after a restart.
This has also already been built: #56264 adds list to the plugin session domain (both the Promise and Effect APIs). It passes the full SessionListInput through, including parentID, so ctx.session.list({ parentID }) works the way you proposed. It was merged to dev after v2.0.31 and v2.0.32 were tagged, so it isn't in those versions yet.
Possible duplicates and related items, ordered by likelihood:
Closing this as a duplicate of #43517. No reply came in the day since, explaining how this request differs. Please follow #43517 for updates.
As a reminder, #56264 adds ctx.session.list(...) to the plugin session API, and you can pass parentID to it. It is merged on dev, but it is not in v2.0.31 or v2.0.32. If something you need is still missing once it ships, please comment on #43517 or open a new issue describing the gap. Thanks again for the clear write-up!
Activity
opencode-agent commentedon Oct 19, 2026
Thanks for the detailed write-up! I think this is a duplicate of #43517, which asks for the same
ctx.session.list({ parentID, ... })access for v2 plugins, for the same reason: finding child sessions again after a restart.This has also already been built: #56264 adds
listto the plugin session domain (both the Promise and Effect APIs). It passes the fullSessionListInputthrough, includingparentID, soctx.session.list({ parentID })works the way you proposed. It was merged todevafter v2.0.31 and v2.0.32 were tagged, so it isn't in those versions yet.Possible duplicates and related items, ordered by likelihood:
session.listwith aparentIDfilter, and finding child sessions again after a restart)ctx.session.listto pluginsThe bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.
iceteaSA commentedon Oct 19, 2026
Thanks. This duplicates #43517, and #56264 already adds
ctx.session.list({ parentID })to the plugin session domain. Closing in favor of those.opencode-agent commentedon Oct 20, 2026
Closing this as a duplicate of #43517. No reply came in the day since, explaining how this request differs. Please follow #43517 for updates.
As a reminder, #56264 adds
ctx.session.list(...)to the plugin session API, and you can passparentIDto it. It is merged ondev, but it is not in v2.0.31 or v2.0.32. If something you need is still missing once it ships, please comment on #43517 or open a new issue describing the gap. Thanks again for the clear write-up!