Skip to content

[FEATURE]: Plugin API: list sessions and child sessions by parent ID #57212

Closed as duplicate

Description

@iceteaSA

Problem

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.

Activity

  1. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    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:

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your request is different.

  2. iceteaSA commented on Oct 19, 2026

    @iceteaSA
    Author

    Thanks. This duplicates #43517, and #56264 already adds ctx.session.list({ parentID }) to the plugin session domain. Closing in favor of those.

  3. opencode-agent commented on Oct 20, 2026

    @opencode-agent
    Contributor

    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!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions