Skip to content

[FEATURE]: Expose message-free session resume to V2 plugins #58390

Open

Description

@ShubDVS

Feature hasn't been suggested before.

Describe the enhancement you want to request

In OpenCode V2 2.1.3, core has a message-free Session.resume operation, but plugins cannot call it. A custom continuation command currently has to admit a synthetic message, which adds an instruction to the model's context.

Please expose the existing resume operation to plugins, for example ctx.session.resume({ sessionID }), so a plugin can start or join primary execution from existing history without admitting another conversation message. Preserve native session validation, permissions, cancellation, and completed tool results.

Related: #52496 adds HTTP/client resume but does not expose it through the plugin session interface. #44921 requests a native continuation command. The earlier API request #46198 and PR #46197 were closed without merging.

Could maintainers approve this plugin API addition? I'd like to implement it after design approval.

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed request! To restate it: you'd like plugins to be able to call the existing message-free session resume, e.g. ctx.session.resume({ sessionID }). A plugin could then start or join primary execution from the existing history without adding a synthetic message to the model's context.

    I checked the code. Core has Session.resume, but the plugin session interface (SessionDomain in @opencode/plugin) doesn't include it, and SessionApi in the client doesn't have a resume method yet either. So a plugin today can only add a message (prompt/synthetic) or use interrupt({ resume: true }), which cancels first. Supporting this would mean adding resume to SessionApi and to the plugin SessionDomain for both the Promise and Effect versions. It should keep the native session validation and errors.

    Maintainers will look at this and decide on the design. Related items:

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

Metadata

Metadata

Assignees

No one assigned

    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