You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When users have many sessions, it becomes difficult to identify which session was used for what purpose. Currently, the session list (both CLI and TUI) only shows:
Session ID
Title
Last updated timestamp
This makes it hard to distinguish between sessions, especially when users work with multiple models for different types of tasks.
Proposed Solution
Add model information to the session list display. This would show which model the session was started with, helping users quickly identify sessions based on the model used.
Why the starting model?
The starting model indicates the user's intent for that session (e.g., a fast model for quick questions vs. a capable model for complex refactoring)
It provides consistent, predictable information that doesn't change as the session progresses
Users can easily correlate sessions with their workflow patterns
Implementation Details
Data Source
Model information is currently stored at the message level, not the session level:
User messages contain: model: { providerID, modelID }
Assistant messages contain: modelID, providerID
To get the starting model, we need to query the first message of each session.
Changes Required
Session Table Schema (src/session/session.sql.ts)
Add model column to store { provider_id: string, model_id: string }
Session.Info Schema (src/session/index.ts)
Add optional model field: { providerID: string, modelID: string }
Session List Logic (src/session/index.ts)
Modify Session.list() and Session.listGlobal() to include model from session table
Problem
When users have many sessions, it becomes difficult to identify which session was used for what purpose. Currently, the session list (both CLI and TUI) only shows:
This makes it hard to distinguish between sessions, especially when users work with multiple models for different types of tasks.
Proposed Solution
Add model information to the session list display. This would show which model the session was started with, helping users quickly identify sessions based on the model used.
Why the starting model?
Implementation Details
Data Source
Model information is currently stored at the message level, not the session level:
Usermessages contain:model: { providerID, modelID }Assistantmessages contain:modelID,providerIDTo get the starting model, we need to query the first message of each session.
Changes Required
Session Table Schema (
src/session/session.sql.ts)modelcolumn to store{ provider_id: string, model_id: string }Session.Info Schema (
src/session/index.ts)modelfield:{ providerID: string, modelID: string }Session List Logic (
src/session/index.ts)Session.list()andSession.listGlobal()to include model from session tableCLI Output (
src/cli/cmd/session.ts)TUI Display (
src/cli/cmd/tui/component/dialog-session-list.tsx)REST API (
src/server/routes/session.ts)Performance Considerations
Acceptance Criteria
session listshows model column in table outputsession list --format jsonincludes model in JSON outputReferences
Session schema:
packages/opencode/src/session/session.sql.tsSession list CLI:
packages/opencode/src/cli/cmd/session.tsTUI session list:
packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsxMessage types with model:
packages/opencode/src/session/message-v2.tsI have verified this feature hasn't been suggested before