feature: send prompt in a new session
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- lua
- Domain
- api, developer-experience
Research direction
Start at the ask(default, opts) entry point and read the session API documentation for session.create, session.switchModel, and model.list. Trace how the latest session and model are currently obtained. Done means ask can either append to the latest session or create a new one, using the latest model or opening a picker when no session exists.
Written by the indexing model from the issue text.
Description
Prerequisites
- I searched the docs
- I searched existing issues
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
- Dominant language
- Lua
- Stars
- 3.8k
- Forks
- 161
- Avg merge
- 16h 31m
- Merged PRs (30d)
- 4
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nickjvandyke/opencode.nvim
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nickjvandyke/opencode.nvim#336 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
nickjvandyke/opencode.nvim#321 · 2 comments · 1 reaction ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
nickjvandyke/opencode.nvim#41 · 1 comment · 9 reactions ·
All issues in nickjvandyke/opencode.nvim
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Facepunch/garrysmod-issues#7077 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AstroNvim/astrotheme#184 ·
-
[Minetest] IssueOpen
Difficulty 1/5 Under an hour Newbie friendliness 92/100
pterodactyl/game-eggs#639 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100