Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feature: send prompt in a new session

Open
#335 1 comment 0 reactions 0 assignees View on GitHub

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

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

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nickjvandyke/opencode.nvim

All issues in nickjvandyke/opencode.nvim

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.