anomalyco / anomalyco/opencode

tui: bindable "set as default model for this agent" action in model dialog

Open
#47,836 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

The model dialog (/models) supports ctrl+f to favorite a model, but there is no way to persist a model as the default for an agent from the UI. Setting an agent default — including for subagent-mode agents — currently requires hand-editing opencode.json(c) or agent Markdown frontmatter.

Environment

  • opencode version: 0.0.0-beta-19157
  • OS: Linux 7.1.6-arch1-1 (x64)
  • Terminal: ghostty (xterm-ghostty, truecolor)
  • Shell: /usr/bin/bash
  • Install/channel: beta
  • Active plugins: omo-v2 (local), local TUI plugins under ~/.config/opencode/plugins/tui

Reproduction

  1. Open /models in the TUI and highlight a model.
  2. Press ctrl+f — favorite toggles.
  3. Look for a "set as default" action — none exists.

Expected Behavior

A bindable action in the model dialog (e.g. ctrl+d) that sets the highlighted model as the default model for the current agent — equivalent to writing agents.<id>.model in config. Ideally this also works for subagent-mode agents, e.g. reachable from the agent list or a child-session view, since subagent models are otherwise only configurable by editing config files by hand. Subagents that have no configured model silently inherit the parent session model, so there is currently no UI surface at all for controlling what model a subagent runs on.

Actual Behavior

No such action exists. Switching an agent's default model requires manually editing agents.<id>.model in opencode.json(c) or the agent's frontmatter.

Additional Context

/models on a primary session only changes that session's model; it does not persist a per-agent default. As a workaround I built a local TUI plugin with its own agent→model picker dialog that writes agents.<id>.model (format-preserving JSONC edit). The missing built-in pieces are:

  1. A "set as default for this agent" action in the model dialog.
  2. Agent context in that action so it can target subagents, not just the current primary agent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the TUI model dialog at /models, using the existing ctrl+f favorite action as the nearest reference. Trace how the current agent is identified and how agents.<id>.model is represented in opencode.json(c) and agent Markdown frontmatter, including subagent sessions. Done means a bindable action persists the highlighted model for the intended agent without losing JSONC formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.