Skip to content

feat(rename): add session rename command - #317

Open
Alex-duzhichao wants to merge 1 commit into
nickjvandyke:mainfrom
Alex-duzhichao:rename_session
Open

feat(rename): add session rename command#317
Alex-duzhichao wants to merge 1 commit into
nickjvandyke:mainfrom
Alex-duzhichao:rename_session

Conversation

@Alex-duzhichao

Copy link
Copy Markdown
  • Track the TUI's active session via tui.session.select events
  • Add Server:update_session() using PATCH /session/:id
  • Route session.rename and session.select through command() instead of the TUI
  • Expose rename_session() on the public API

Tasks

  • I read CONTRIBUTING.md
  • I ensured my changes pass automated checks
  • I reviewed and understand the AI-generated code in my changes (if any)

Description

Testing

  1. Run :lua require("opencode").select() to open select picker
  2. Select the session.rename
  3. Change the session name

Related Issue(s)

Screenshots/Videos

- Track the TUI's active session via `tui.session.select` events
- Add `Server:update_session()` using `PATCH /session/:id`
- Route `session.rename` and `session.select` through `command()` instead of the TUI
- Expose `rename_session()` on the public API
@nickjvandyke

Copy link
Copy Markdown
Owner

Thanks for your contribution! This seems reasonable to include. Nice solution to track the active session. That's been an issue historically and I didn't think of this! I'll take a closer look when I get the chance.

Does OpenCode emit tui.session.select when a new session is created? Wondering if we need to track more events. Also wondering how to handle when we first connect to the server. I presume we can't get the session at that time, and must hide/disable the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants