-
-
Notifications
You must be signed in to change notification settings - Fork 67
feat(sessions): select session #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds functionality to select and switch between existing OpenCode sessions through the UI.
Changes:
- Adds a new
select_sessionUI component that fetches and displays sessions - Integrates session selection into the command menu
- Adds API client methods for retrieving and selecting sessions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/opencode/ui/select_session.lua | New module implementing session selection UI with sorting and formatting |
| lua/opencode/ui/select.lua | Adds special handling for the "session.select" command |
| lua/opencode/config.lua | Registers "session.select" in the commands configuration |
| lua/opencode/cli/client.lua | Adds get_sessions and select_session API methods |
| lua/opencode.lua | Exports the select_session function in the main module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| prompt = "Select session (recently updated first):", | ||
| format_item = function(item) | ||
| local title_length = 60 | ||
| local updated = os.date("%b %d, %Y %H:%M:%S", item.time.updated / 1000) |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timestamp is being divided by 1000, suggesting it's in milliseconds, but os.date expects Unix time in seconds. This division should be applied consistently or the timestamp should already be in seconds from the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's best to keep it in milliseconds since this is what opencode returns.
Re: #123. One way to check this out is to open the main select dialogue and pick the select session command.