Prerequisites
Is your feature request related to a problem? Please describe.
One of the most common usecase that I have with this plugin is creating a little session to tweak. Something like a Ctrl+k feature from Cursor (not sure if it still has it). Previously on opencode v1, I was using new_session tui command, before sending the prompt. Unfortunately, opencode v2 removed the tui API, so we kinda have to target the session API.
Describe the solution you'd like
Add an option to the ask(default, opts) on whether to append the prompt to the latest session (like the current behaviour), or create a new session with that prompt.
I tested this on a local fork, but by default the create new session API will use a model from opencode go (even if you're using other providers and don't have subscription from opencode go). So, from our side, we have to know what model on that session. I'm proposing the following heuristic:
- Use the model from the latest session
- If there's no session, open a picker popup to let the user pick the model
Describe alternatives you've considered
None, the solution space is quite limited.
Additional context
https://opencode.ai/v2/docs/api#session.create
https://opencode.ai/v2/docs/api#session.switchModel
https://opencode.ai/v2/docs/api#model.list
Prerequisites
Is your feature request related to a problem? Please describe.
One of the most common usecase that I have with this plugin is creating a little session to tweak. Something like a
Ctrl+kfeature from Cursor (not sure if it still has it). Previously on opencode v1, I was usingnew_sessiontui command, before sending the prompt. Unfortunately, opencode v2 removed the tui API, so we kinda have to target the session API.Describe the solution you'd like
Add an option to the
ask(default, opts)on whether to append the prompt to the latest session (like the current behaviour), or create a new session with that prompt.I tested this on a local fork, but by default the create new session API will use a model from opencode go (even if you're using other providers and don't have subscription from opencode go). So, from our side, we have to know what model on that session. I'm proposing the following heuristic:
Describe alternatives you've considered
None, the solution space is quite limited.
Additional context
https://opencode.ai/v2/docs/api#session.create
https://opencode.ai/v2/docs/api#session.switchModel
https://opencode.ai/v2/docs/api#model.list