Skip to content

Feature request: Start and continue a session with opencode run -s (modify flag behavior) #3434

Closed as not planned

Description

@621625

Hi guys,

Hope you are well.

I would like to make a feature request, I think this would be a wise and efficient design choice, even somewhat popular:

Modify the behavior of the opencode run --session flag.

Current behavior:

Input: opencode run --session ses-abc (or abc) hello
Output: "Resource not found" (if ses-abc) or "Invalid string - must start with ses" if plain abc.

Desired behavior:

Input: opencode run --session abc hello
Output: "Hello how can I be of assistance?"

Here opencode will create session abc if it doesn't exist and continue it if it exists.

Implement this, it's a good idea. Trust me.

Activity

  1. rekram1-node commented on Oct 25, 2025

    @rekram1-node
    Member

    The --session is meant to continue a given session, with this behavior it would be harder to detect if the session you passed even exists wouldnt it?

    As in there is some tradeoff of not erroring

  2. 621625 commented on Oct 26, 2025

    @621625
    Author

    No this is trivial. If the session exists, resume it. If the session does not exist, create it and run it. This is how it should be from an UX/UI viewpoint. It makes users feel safe, comfortable and empowered. It's efficient.

    I can't find the session ID's at all so I don't know how to manipulate them yet. Is there a folder full of session ID's? Surely we don't have to go into TUI to get the session ID's, right?

  3. rekram1-node commented on Oct 26, 2025

    @rekram1-node
    Member

    we only really surface them via the opencode export command

  4. tomjose92 commented on Feb 25, 2026

    @tomjose92

    In addition to the example given in the description, I would like to have this feature so that a meaningful title can be provided when creating the session.
    My current flow invokes multiple Agent skills as part of a single session, but the name is based on the first skill (which is very vague). It would help if i can configure the session id name, so that when going through sessions, i can easily be able to identify by some metadata added to the session name

  5. mingfai commented on Mar 9, 2026

    @mingfai

    Trying to switch from Github Copilot CLI to OpenCode. The former uses uuid as session id, and allow using a non-existed uuid to start, so I make an alias that generates a uuid with the project path as session id parameter, so whenever I start a CLI at a particular project root, it always use the same session id.

    Other than this session resume feature, OpenCode is way better overall. Really wish Opencode has an equivalent way to resume session.

  6. LucasArthur94 commented on May 8, 2026

    @LucasArthur94

    +1 for this! This is the only blocker today to use the OpenCode in my workflow, even with a better execution in comparison to other harness tools :/.

  7. maliayas commented on Jun 13, 2026

    @maliayas

    +1. Session name appears in the tab title as well. So a name given by the user better identifies the tab among many tabs. As well as in the "view/resume session" list.

  8. github-actions commented on Aug 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  9. Hi-Angel commented on Oct 29, 2026

    @Hi-Angel

    Folks, last comment asked to re-create the issue, done here, pls resubscribe.

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