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

Open
opened 2026-02-16 17:34:56 -05:00 by yindo · 3 comments
Owner

Originally created by @621625 on GitHub (Oct 25, 2025).

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.

Originally created by @621625 on GitHub (Oct 25, 2025). 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.
Author
Owner

@rekram1-node commented on GitHub (Oct 25, 2025):

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

@rekram1-node commented on GitHub (Oct 25, 2025): 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
Author
Owner

@621625 commented on GitHub (Oct 26, 2025):

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?

@621625 commented on GitHub (Oct 26, 2025): 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?
Author
Owner

@rekram1-node commented on GitHub (Oct 26, 2025):

we only really surface them via the opencode export command

@rekram1-node commented on GitHub (Oct 26, 2025): we only really surface them via the `opencode export` command
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2277