feature: send prompt in a new session
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- lua
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Lua
- 星标
- 3.9k
- 派生
- 161
- 平均合并
- 9 天 9 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nickjvandyke/opencode.nvim 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
nickjvandyke/opencode.nvim#321 · 2 条评论 · 1 个 reaction ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 52/100
nickjvandyke/opencode.nvim#41 · 1 条评论 · 9 个 reaction ·
查看 nickjvandyke/opencode.nvim 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 82/100
danreeves/darktide-mods#321 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
caelestia-dots/caelestia#534 · 1 条评论 ·
维护者通常 1 天内回复
-
bug P2
难度 2/5 1-3 小时 新手友好度 78/100
sfeSantos/cell-block-zero#48 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
bookorbit/bookorbit#1972 · 2 个 reaction ·
维护者通常 3 天内回复