Skip to content

fix(models): list models.json models by name in the Models sidebar - #1408

Open
maximilize wants to merge 1 commit into
agegr:mainfrom
maximilize:fix/models-sidebar-model-name
Open

maximilize wants to merge 1 commit into
agegr:mainfrom
maximilize:fix/models-sidebar-model-name

Conversation

@maximilize

Copy link
Copy Markdown
Contributor

What

The model rows in Settings › Models list a models.json model by its name and fall back to its id, as the model selector and the chat already do. A model without a name still shows its id, and a new row still shows "New model". The id stays in the model's editor.

Why

In #885 the Web UI settled on showing model names: users set them in models.json, while the id is fixed by the provider and often hard to read. The Models sidebar was the one place still showing m.id, so the same model read differently there than in the selector and the enabled-models list of the same panel.

How

  • components/models-config-helpers.ts: modelSidebarLabel() returns the trimmed name, otherwise the id.
  • components/ModelsConfig.tsx: the sidebar's model row uses it.
  • components/ModelsConfig.test.mjs: name, missing name, blank name, new row.
  • e2e/model-discovery.mjs: the relay fixture's model gets a name, and the check asserts the sidebar shows it. With the ModelsConfig.tsx line reverted this assertion fails (0 !== 1).
  • docs/agents/models.md: one sentence next to the selector note.

Checks

npm test, node_modules/.bin/tsc --noEmit, npm run lint. In my container the same 5 tests fail on unchanged main as on this branch (CLI and read-only dir cases, root user without network), the new test passes. For npm run test:e2e the font metrics step and the /api/app-update request need fonts and network the container lacks, so I ran it with that step skipped: the discovery check passes with the change and fails without it.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

1 participant