Skip to content

feat(opencode): add model details panel in TUI model selection menu#21551

Open
Tao-Yida wants to merge 12 commits intoanomalyco:devfrom
Tao-Yida:feat/tui-model-details-sidebar
Open

feat(opencode): add model details panel in TUI model selection menu#21551
Tao-Yida wants to merge 12 commits intoanomalyco:devfrom
Tao-Yida:feat/tui-model-details-sidebar

Conversation

@Tao-Yida
Copy link
Copy Markdown

@Tao-Yida Tao-Yida commented Apr 8, 2026

Issue for this PR

Closes #19411

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a model details panel to the TUI model picker (Ctrl+P → Switch model).
When selecting a model in the dialog, a right-side panel now shows:

  • provider name
  • supported input types
  • reasoning support
  • context limit
  • context status (sufficient / warning for next-turn compaction / insufficient)

This keeps model switching behavior unchanged while making model selection more informed.

How did you verify your code works?

Manual test in TUI:

  • Open command palette (Ctrl+P) → Switch model
  • Confirm right-side details panel renders and updates with selection
  • Confirm context status color/text changes based on session context and selected model
  • Confirm model selection still works as before (Enter to switch)

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Show model capabilities, reasoning support, context limit, and context readiness status in a right-side details panel while keeping keyboard selection behavior unchanged.

Made-with: Cursor
Copilot AI review requested due to automatic review settings April 8, 2026 18:17
Copy link
Copy Markdown
Contributor

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

Adds an informational “model details” side panel to the TUI model picker (Ctrl+P → Switch model) so users can view provider + capability metadata and a context-fit status while navigating the list.

Changes:

  • Extend DialogSelect with an optional details panel that conditionally renders on sufficiently wide terminals.
  • Update DialogModel to set a larger dialog size and provide a model-details renderer (provider, input modalities, reasoning support, context limit, and a context status indicator).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx Adds an optional right-side details panel to the generic selection dialog when terminal width allows.
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx Implements the model-details panel content and computes a context status indicator for the currently highlighted model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx Outdated
Comment thread packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
@Tao-Yida
Copy link
Copy Markdown
Author

Tao-Yida commented Apr 8, 2026

These failures look unrelated to this TUI change:

  • E2E (Windows) job 70485790530: multiple unrelated specs timed out with "TypeError: fetch failed" / "[cause]: Error: read ECONNRESET". Stack traces hit the SDK request/bootstrap paths (client.gen.ts, waitSession/gotoSession). This looks like transient CI/network or test-app connectivity resets, not a functional regression from the TUI changes.
  • Unit test (Linux) job 70493265152: a single deterministic unit test failed — test/memory/abort-leak.test.ts ("webfetch does not leak memory..."). That points to webfetch/AbortController cleanup (packages/opencode/src/tool/webfetch.ts and packages/opencode/src/util/abort.ts), again unrelated to the TUI files changed here.

Please re-run the test to verify that the errors are due to the latetest version of the dev branch of opencode.

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.

[FEATURE]: Show Metadata (e.g. Model Context Limit) while Selecting Models in Opencode CLI Menu

2 participants