Skip to content

Conversation

@nkabbara
Copy link

@nkabbara nkabbara commented Jan 19, 2026

Re: #123. One way to check this out is to open the main select dialogue and pick the select session command.

@nkabbara nkabbara changed the title feat(sessions): select sessions Re: #123 feat(sessions): select session Re: #123 Jan 19, 2026
@nkabbara nkabbara changed the title feat(sessions): select session Re: #123 feat(sessions): select session Jan 19, 2026
@nkabbara nkabbara changed the title feat(sessions): select session feat(sessions): select session Jan 19, 2026
@NickvanDyke NickvanDyke requested a review from Copilot January 20, 2026 15:03
Copy link

Copilot AI left a 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_session UI 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)
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

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.

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