Skip to content

feat(tui): add session.model_label to show provider and model IDs - #54962

Closed
Nowaker wants to merge 1 commit into
anomalyco:devfrom
Nowaker:v2-model-label
Closed

Nowaker wants to merge 1 commit into
anomalyco:devfrom
Nowaker:v2-model-label

Conversation

@Nowaker

@Nowaker Nowaker commented Oct 12, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #53638

Type of change

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

What does this PR do?

Footers and the prompt name a model by its display name. The same model served by two providers looks identical, and the name is not what a config or the model picker takes.

This adds session.model_label (name by default, or id). With id, assistant footers and the prompt show providerID/modelID, e.g. anthropic/claude-sonnet-4-5.

How did you verify your code works?

bun run typecheck and bun test test/config-v2.test.tsx in packages/tui. I also ran it in a real terminal: a TUI from this branch (serve --stdio plus --server) on a throwaway tmux server, scratch data dir, and a fake OpenAI-compatible provider on loopback. With session.model_label: "id", the footer shows fake/fake-model. The same check fails on dev.

Screenshots / recordings

Text captures are in the description above.

Checklist

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

This PR is AI generated, but under direct supervision and on request of @Nowaker.


Added by the opencode bot (AI-generated).

Related: #53846

Public API: adds the optional TUI config key session.model_label (name | id, backwards compatible)

Footers and the prompt name a model by its display name, which is the same
for a model served by two providers, or by a provider and its clone, and
is not what a config or a model picker takes. session.model_label: id
shows providerID/modelID instead, in assistant footers and below the
prompt. The default is unchanged.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described. I ran the TUI from source with the simulated model and session.model_label: "id". On the base, the footer reads Build · Simulated Model. With this PR, both the footer and the prompt read simulation/gpt-sim-model. The default name keeps today's output. The new config test and typecheck in packages/tui pass.

Public API: adds one optional TUI config key, session.model_label ("name" | "id", default "name"), with a matching settings-dialog entry and docs row. Backwards compatible: existing configs are unaffected. The server, SDK and plugin APIs are unchanged.

One small thing is noted inline: in id mode, the prompt drops the (unavailable) marker for a model that isn't in the catalog.

Related: #53846

Before

After

const selection = local.model.selection()
if (config.session?.model_label !== "id" || !selection)
return { modelLabel: parsed.model, providerLabel: parsed.provider }
return { modelLabel: `${selection.providerID}/${selection.modelID}`, providerLabel: "" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In id mode this always returns provider/model. If the selected model isn't in the catalog, parsed().model would have shown <id> (unavailable), but here that hint is lost, so the prompt looks normal for a model that can't be used. Could you keep the marker in id mode? For example, append (unavailable) when the model isn't found in the catalog.

@Nowaker

Nowaker commented Nov 10, 2026

Copy link
Copy Markdown
Author

Closing this for now: I'm limiting myself to at most 3 open PRs on this repo to keep the review load reasonable. I may reopen it later. Thanks for your time!

@Nowaker Nowaker closed this Nov 10, 2026
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 the provider and model id in message footers

1 participant