Skip to content

feat(models): show backends' own model names in the harness picker - #22985

Merged
iamwhatever merged 2 commits into
kirodotdev:mainfrom
bobbyrc:feat/harness-model-picker
Oct 28, 2026
Merged

iamwhatever merged 2 commits into
kirodotdev:mainfrom
bobbyrc:feat/harness-model-picker

Conversation

@bobbyrc

@bobbyrc bobbyrc commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Show each backend's own model names in the harness model pickers, instead of stale registry labels or raw ids.

The harness model picker titled rows from the model id and a static registry, not the name the backend advertises over ACP. Claude Code's picker read stale versioned labels (e.g. "Opus 4.8 (1M context)") where the backend means "Opus 5.5", and Codex showed only auto because its advertised list was never persisted across sessions. With no live session (a cold gateway start) the picker fell back to raw ids like claude-sonnet-5.

Why it matters

The model picker is how a user chooses which model a chat runs on. Showing a stale or wrong name — or a raw id — makes the user pick blind, and makes the two supported Claude/Codex harnesses look broken relative to their own native CLIs, which show the correct names.

Not a goal

  • Does not change which models a backend advertises, or invent names the backend did not send. Labels are shown verbatim.
  • Does not fix haiku running Haiku 4.5 on the Claude backend. That is caused by the gateway's seeded availableModels allowlist, not by claude-agent-acp, and is tracked separately in claude_code: the seeded availableModels allowlist makes haiku run Haiku 4.5 #22995.
  • Does not change the id an interactive picker selection sends. One wire change is in scope: on Claude Code, to_provider_id sends a bare family alias (opus, sonnet, haiku, fable) unchanged, but only when the backend itself advertised that alias. Without it, a cron job, a pooled-session switch or a configured default of opus sends claude-opus-4-8, so the new "Opus 5.5" label would be false on those paths. With a cold cache, or a backend that advertises only versioned ids (e.g. Bedrock global.anthropic.*), the registry fold applies as before.
  • Does not add a new model-selection surface.

What changed (motivation → approach → change)

The model pickers title each model with the name its backend advertises over ACP; the id a selection stores and sends is unchanged.

Root cause: the advertised-model cache stored ids only, and the frontend had no field for a display label, so rows were titled on the id.

Part Change
Capture (acp/) session/new, session/load (runtime_session_create.py, runtime_session_load.py) and the direct-spawn path (client_model_selection.py) read each advertised model's name/description; session_handle_model_selection.py persists them off the event loop. On the shared runtime the cache is fed and persisted only for an ACP_BACKENDS_ADVERTISED_MODEL_SELECTION member, gated at the create and load call sites as client_start.py gates its persist, so kiro's create and load gain no call (H13).
Cache (model_registry.py) Labels live in a reserved sidecar key, __labels__; id-only files still load. advertised_model_rows() serves them when no session is live. A live session's rows go through the same admission (live_advertised_model_rows()): an id over 256 characters is refused and a label's name and description are cut to ADVERTISED_LABEL_MAX_CHARS (400), so live and cached rows carry the same bounds. to_provider_id sends a bare Claude Code family alias (CLAUDE_CODE_PASSTHROUGH_ALIASES) unchanged only when the backend advertised it. That reaches every to_provider_id caller: cron runs, the session pool's switch, the configured default and the in-chat live switch (dashboard/chat_api/slot_model.py). A backend whose rows carry no labels does not re-persist the sidecar.
API (dashboard/handlers/agents.py) /api/models carries display_name; two advertised ids that fold to one registry key keep separate rows. A versioned id claims the registry row before a bare family alias, which names Claude Code's current model, and an alias with no native label shows its own id. _cc_models hands that row merge to merge_advertised_rows in the new dashboard/handlers/agents_cc_model_rows.py, so agents.py stays under the 2,000-line cap now that main has grown it; the facade's _normalize_model_key is passed in, so a patch of it still reaches the merge.
UI (website/src) ModelInfo.displayName (providers/types.ts, mapped in providers/adapters/acp.ts) titles Selectable Models (pages/settings/ChatPanel.tsx) and the in-chat picker list (components/ModelDropdownList.tsx), and picker search (useFilteredDropdown.ts) matches it. The active row is found by exact id before a normalized match (lib/model.ts), and a grouped effort row drops a single variant's name (useInteractiveModels.ts). The auto row keeps its catalog label. A kiro-cli row whose printed name differs from its id (already sent as display_name) is titled the same way. In both lists a named row shows the name in the body font and its id after it in small monospace (components/MultiSelect.tsx gains an optional hint for the Selectable Models row), so the row still matches the composer chip, the Default Model select and the config file, which show the id; a row without a name keeps its id alone.
Docs docs/system-specs/common/model-selection.md documents the alias passthrough and how Claude rows are labelled; docs/system-specs/modules/learn-cron-dashboard.md names the new row-merge module beside the agents.py facade.
Tooling website/scripts/capture-harness-model-picker.mjs renders the screenshots below; website/capture/chat-model-picker-native-names.{html,tsx} mounts the real composer and in-chat picker for the in-chat shots. .github/black-baseline.txt drops test/test_model_registry.py, which is black-clean.

Backwards compatibility

Compatible: the persisted sidecar adds a new reserved key (__labels__); an existing id-only advertised-model file still loads and simply has no labels until the next capture. The frontend displayName is optional and falls back to the id. No field is removed, renamed, or made required.

Removes nothing: no path, record, key, or public function is hidden, deleted, tightened, or renamed.

Tests

  • test/test_model_registry.py — label persistence in the sidecar, legacy id-only load, the native-name-wins merge, and the alias passthrough only for an advertised alias.
  • test/test_cc_models_endpoint.py — /api/models maps modelId/name/description, the backend's label wins over a stale registry version, and two advertised ids sharing a key stay distinct. test_registry_display_name_wins_for_survivors is deliberately reversed as test_advertised_native_name_wins_for_survivors (claude backend: bare model aliases (sonnet/opus/haiku/fable) resolve to stale versions instead of Claude Code's current model #21747): a backend name that differs from its id now wins over the registry label; a name equal to the id still falls back to the registry.
  • test/test_codex_advertised_models.py — Codex configOptions capture persists labels and survives a cold reload with no live session; a cached label is cut to the label bound, and live and cached rows for one payload are identical. A backend whose rows carry no labels reports no change on a repeat capture, so it does not rewrite the sidecar every session.
  • test/test_cc_models_endpoint.py — an oversized live label is cut to the cache's bound in _advertised_cc_models and in the assembled /api/models rows, and a live id past the id bound never reaches the picker.
  • test/test_cc_models_endpoint.py — a versioned id claims the registry row before a bare alias, and an unlabelled alias shows its id.
  • test/test_session_handle_bindings.py, test/conftest_resets.py — the session handle's member inventory carries the feed and persist hooks; the label cache is reset between tests.
  • test/test_acp_runtime_load_session.py — a kiro create_session and load_session never feed or persist the advertised-model cache (H13); test/test_acp_codex_harness.py — a codex create_session feeds and persists it once.
  • test/test_session_pool.py — on Claude Code, a pooled session on the versioned flagship id switches to an advertised bare opus, and keeps the registry fold (no switch) when opus is not advertised.
  • website/src/test/useFilteredDropdown.test.tsx, website/src/test/ChatPanel.modelVisibility.test.tsx — search matches displayName; a Selectable Models row renders the native name with its id as a hint while toggling writes the id, and a row without a name carries no hint.
  • website/src/test/MultiSelect.hint.test.tsx — the hint renders only on a row that has one, and search still matches the id; a 400-character label and description stay in truncating elements with the hint shown.
  • website/src/test/AcpAdapter.models.test.ts — the auto row carries no backend display name.
  • website/src/test/ModelDropdownList.displayName.test.tsx — a named row shows the name without font-mono and the id in a monospace hint; an unnamed row, or one whose name equals its id, shows the monospace id and no hint; a 400-character label stays on one truncated line with its id hint.
  • website/src/test/model.displayModel.test.ts, website/src/test/useInteractiveModels.test.ts — with fable and claude-fable-5 both listed, the pinned or inherited id checks its own row; a grouped effort row without a base row carries no variant's display name.

Determinism proof (428 tests on the rebased tree: the 38 added or changed backend tests plus test/test_session_handle_bindings.py): 20/20 runs at -n0; 10/10 at -n 4 --dist loadgroup --max-worker-restart=2; a shuffled order green, seed 28411. Frontend (95 tests in the seven changed test files): 10/10 repeats, and --sequence.shuffle --sequence.seed=40213 green.

Manual verification

Drove both ACP bridges' session/new directly against a live account: Claude Code advertised "Opus 5.5" / "Sonnet 5.5"; Codex advertised "6.1 Sol" / "6 Astra" / "Daybreak Blue" — each matching that backend's native CLI picker. Rendered the real ChatPanel Selectable Models list against mocked /api/models for the screenshots below.

Screenshots / video

Selectable Models (Settings → Chat → Model), rows titled on the backend's own names with each id beside them:

Claude Code harness, dark — Opus 5.5 / Fable 5.1 / Sonnet 5.5 / Opus 5 / Sonnet 5
Codex harness, dark — 6.1 Sol / 6 Astra / 6 Luna / Daybreak Blue

Claude Code harness, light theme

Claude Code harness, light theme

In-chat picker (composer, Claude Code harness): the open list titles rows on the backend's names with each id beside it; the chip shows the id opus, matching the checked row's id.

In-chat picker, dark — Opus 5.5 (opus, checked) / Fable 5.1 / Sonnet 5.5 / Opus 5, chip reads opus

In-chat picker, light theme

In-chat picker, light theme

Related Issues

Fixes #21747
Fixes #22318

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable) — docs/system-specs/common/model-selection.md documents the alias passthrough
  • No secrets, credentials, or internal references in the diff

@bobbyrc
bobbyrc requested review from a team and KiroCrewCaptain as code owners October 22, 2026 01:10
@bobbyrc
bobbyrc requested a review from mbriones98 October 22, 2026 01:10
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 22, 2026
@bobbyrc
bobbyrc force-pushed the feat/harness-model-picker branch from a0b0ea6 to 7a0d295 Compare October 22, 2026 01:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 547270c8cd6e3be91ca380873bcfd24d79f35fbd via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. One note: the session handle's new persist step copies an existing method word for word, and a return value would do the same job.

Notes

  • Item 2 — oversized: session_handle_model_selection.py adds the _advertised_models_changed field and _persist_advertised_models_if_changed, a copy of client_model_selection.py:326-339. Both callers already run handle._feed_advertised_model_cache() and await handle._persist_advertised_models_if_changed() back to back, so nothing needs to carry the flag across a method boundary. The callers already check ACP_BACKENDS_ADVERTISED_MODEL_SELECTION, and the feed checks it again (3 checks across 2 paths). Subtraction: have _feed_advertised_model_cache return the bool, and have both call sites run asyncio.to_thread(model_registry.persist_advertised_models) when it is true. Delete the field, the persist method, its two session_handle_class.py bindings, and the feed's own membership check. Clears when: the mechanism is removed, or a human amends the Goal.

What this change ships

Inventory (10 items) — 10 justified

Intent: let users pick a Claude/Codex model by the name the backend itself uses, not a stale label or a raw id. ADDITION.

  1. Picker rows (in-chat and Selectable Models) show the backend's own name, with the id in small monospace beside it — justified
  2. Codex and other advertised-model harnesses keep their model list after a restart or a harness switch (shared-runtime create/load now fill and save the cache) — justified
  3. Backend names are saved under a reserved __labels__ key, so the picker shows them with no live session — justified
  4. On Claude Code, opus/sonnet/haiku/fable are sent as-is when the backend advertised them, so cron jobs and defaults run the backend's current model — justified
  5. Two advertised ids that fold to one key show as two rows, and a versioned id takes the registry row before an alias does — justified
  6. Live advertised rows get the cache's limits: ids over 256 characters refused, names and descriptions cut to 400 — justified
  7. Picker search matches the display name — justified
  8. The active row is found by exact id before a normalized match — justified
  9. A kiro-cli row whose printed name differs from its id is titled with that name — justified
  10. Capture scripts and screenshots force-added under temp-screenshots/ — justified

[FIRST-PRINCIPLES-REVIEWED] 547270c

Description read

[DESCRIPTION-READ] 9aa2234b12c2f12a8c73cf730a193bb06f8a160ed22462724e28686679ade455

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 547270c8cd6e3be91ca380873bcfd24d79f35fbd via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concern blocks this. The labels go into a separate sidecar store, so the id list every entitlement check reads is unchanged. The one change to what gets sent to the backend is scoped to aliases the backend itself advertised, and five committed screenshots show the new surface.

Notes

  • to_provider_id used to be a pure registry lookup. It now also reads the persisted advertised-model cache, so the cache file affects what is sent to the backend, not just what the picker shows. If a gateway was last used on an account that advertised opus and later moves to one that advertises only versioned ids (for example Bedrock), it sends bare opus until the first session refreshes the cache. A test that loads a stale sidecar and checks the next capture overwrites it would pin this.
  • The PR reverses test_registry_display_name_wins_for_survivors. The description calls this deliberate and cites claude backend: bare model aliases (sonnet/opus/haiku/fable) resolve to stale versions instead of Claude Code's current model #21747. Nothing in docs/decisions/ records the opposite choice, so this is a reversal of the old behaviour, not an override of a recorded decision.

[DESIGN-REVIEWED] 547270c

Description read

[DESCRIPTION-READ] 37036bfbf1aff921c535ad52df295c14d8b22b39fac5941d16976ba9426dc24b

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 547270c8cd6e3be91ca380873bcfd24d79f35fbd via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

The committed screenshots show every changed control: picker rows with the backend's model name and a monospace id, in the in-chat picker (light/dark) and Selectable Models (Claude light/dark, Codex). No first-time reader has seen them, because a fork PR gets no blind read here.

Notes

  • The composer chip and the Default Model select still show the bare id (opus), while the open list leads with "Opus 5.5". The id hint ties the two together, but the chip could show displayName too, so the closed and open states use the same word.

[UX-REVIEWED] 547270c

Description read

[DESCRIPTION-READ] aadd8d6e5d508d57942c6a6532207f9044b31eb591cf20ad85cc78b03d0325f9

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 547270c8cd6e3be91ca380873bcfd24d79f35fbd via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 547270c

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 547270c8cd6e3be91ca380873bcfd24d79f35fbd via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 547270c

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 22, 2026
@bobbyrc
bobbyrc force-pushed the feat/harness-model-picker branch from 7a0d295 to b1a0fc2 Compare October 22, 2026 02:27
@bobbyrc

bobbyrc commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Edited Not a goal at the author's explicit request, for two reasons:

  1. The earlier Haiku claim was wrong. claude-agent-acp 0.94.0 advertises haiku as "Haiku 5.5". It reports "Haiku 4.5" only when the gateway's seeded .claude/settings.local.json availableModels allowlist names both haiku and claude-haiku-4-5-20251001. With that allowlist, the Claude Code CLI drops its haiku row, and claude --model haiku actually runs claude-haiku-4-5-20251001. That is a main bug in the seed path, outside this PR's goal. It will be tracked in its own issue.
  2. Disclose the one wire change (Design Review block). On Claude Code, to_provider_id sends a bare family alias unchanged, and only when the backend advertised that alias. Without this, a cron job, pooled-session switch or configured default of opus sends claude-opus-4-8, so the new "Opus 5.5" label would be false on those paths. A cold cache or a versioned-only list (e.g. Bedrock global.anthropic.*) keeps the registry fold, which is pinned by test_claude_code_alias_folds_when_not_advertised and ..._when_backend_advertises_only_versioned_ids.

This push also fixes the GPT block (picker search now matches displayName), keeps fable ("Fable 5.1") and claude-fable-5 as separate rows, and splits the merged legacy-sidecar test back into its own function.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 22, 2026
@bobbyrc
bobbyrc force-pushed the feat/harness-model-picker branch from b1a0fc2 to 3cb26aa Compare October 22, 2026 04:32
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 22, 2026
@bobbyrc
bobbyrc force-pushed the feat/harness-model-picker branch from 3cb26aa to 61be4be Compare October 22, 2026 14:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 22, 2026
@bobbyrc
bobbyrc force-pushed the feat/harness-model-picker branch from 61be4be to 823fd6f Compare October 22, 2026 18:02
@bobbyrc

bobbyrc commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto 5631aab665 to clear the conflict with main, and split agents.py to keep it under the line cap. There is no behaviour change.

  • Conflict: test/test_session_handle_bindings.py only. Main added the elicitation owner's members, and this PR adds _feed_advertised_model_cache and _persist_advertised_models_if_changed. Both are kept, in sorted order.
  • Line cap: main grew dashboard/handlers/agents.py to 1,950 lines, so with this PR it reached 2,007, over the 2,000 cap. _cc_models stays in the facade, as _FACADE_DEFS in test_dashboard_agents_composition_contract.py requires. The row-merge loop this PR extends moved unchanged into merge_advertised_rows in the new dashboard/handlers/agents_cc_model_rows.py. The only edit inside it is _normalize_model_key( → key_of(, and the facade passes its own _normalize_model_key in, so a patch of agents._normalize_model_key still reaches the merge. agents.py is now 1,938 lines. The later seen lookup is now a set, since it is only tested for membership. learn-cron-dashboard.md and the feature map name the new module.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 25, 2026
@bobbyrc

bobbyrc commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

The failing checks on b7854dd454 don't come from this PR's change. Could a maintainer re-run them? I don't have permission to.

Please re-run only the failed jobs, not Update branch, which adds a merge commit and reruns all of CI.

@bobbyrc bobbyrc closed this Oct 26, 2026
@bobbyrc bobbyrc reopened this Oct 26, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 26, 2026
cruisercohen
cruisercohen previously approved these changes Oct 26, 2026

@cruisercohen cruisercohen 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.

Approving head b7854dd.

Verified by reading the code: live and cached advertised rows go through one admission (live_advertised_model_rows / _admit_label_rows). Ids are capped at 256 chars and 512 rows, and names and descriptions are cut to ADVERTISED_LABEL_MAX_CHARS (400), so the bound bolichen97 accepted at cad083c holds; the model_registry.py patch is unchanged since then and the row merge moved to agents_cc_model_rows.py as-is apart from key_of. Labels render as JSX text in truncating spans (no innerHTML). The cache persist runs off the loop, and kiro create/load gain no call. The to_provider_id passthrough is narrow: claude_code only, the four listed aliases only, and only when the backend advertised that alias. No security default changes. All checks are green on this head after the re-runs, and both conditions of the r124 hold (bolichen97's request cleared, the Design note answered) are met.

Non-blocking:

  • refresh_advertised_models: None != {} counts as a change, so a backend that sends no labels re-persists the sidecar on every session. (_ADVERTISED_META.get(provider) or {}) != labels avoids that.
  • The bare-alias passthrough also reaches the in-chat live switch (slot_model.py:163); worth naming in the description next to cron, the pool and the configured default.
  • A small public predicate would be cleaner than reading _CLAUDE_CODE_PASSTHROUGH_ALIASES from the dashboard module.

Not run locally: backend or frontend tests; I relied on CI.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD on b7854dd: three AI notes on this head have no reply.

The change looks sound. Live and cached labels share one bounded admission, so bolichen97's request (now dismissed) is fixed, the reply on the to_provider_id cache dependency settles our r124 question, kiro create/load gain no call, and CI is green.

What clears the hold, a short reply or fix for each:

  • First Principles item 7: kiro-cli rows are relabelled too, outside the Claude/Codex goal (acp.ts L432-L435). Keep it with a reason, or leave displayName unset for kiro-cli.
  • Opus note: refresh_advertised_models treats a missing label entry and {} as different, so a backend that sends no labels re-persists provider_models.json on every session (model_registry.py L692-L700). (_ADVERTISED_META.get(provider) or {}) != labels fixes it.
  • Design note: agents_cc_model_rows.py reads the private _CLAUDE_CODE_PASSTHROUGH_ALIASES (L30). A public predicate, or a reply that the coupling is fine.

— crew-pr-reviewer (r128)

bobbyrc and others added 2 commits October 27, 2026 18:37
The harness model picker showed stale, versioned registry labels (and raw
ids) instead of the names the backend advertises -- so Claude Code's picker
read "Opus 4.8 (1M context)" where the backend means "Opus 5.5", and Codex
showed only auto because its advertised list was never persisted.

Capture each advertised model's native name and description from the ACP
session's models payload, persist them in the advertised-model cache beside
the ids (under a reserved sidecar key, legacy id-only files still load), and
prefer the backend's own label over a colliding registry row when building
the picker. The frontend carries the label through a new displayName field
so the Selectable Models list and the in-chat dropdown title on it, keeping
the id as the wire value, and picker search matches it. Both the
direct-spawn and shared-runtime capture paths feed and persist the labels.
Two advertised ids that fold to one registry key (fable and claude-fable-5)
keep separate rows.

On Claude Code, to_provider_id sends a bare family alias (opus, sonnet,
haiku, fable) unchanged when the backend advertised that alias, so a cron
job, pooled-session switch or configured default runs the model the label
names instead of the registry's older versioned id. A cold cache or a
versioned-only list keeps the registry fold.

Part of kirodotdev#21747, kirodotdev#22318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scripted Playwright capture that renders the real ChatPanel against an
isolated loopback Vite server with /api/models mocked to each backend's
advertised rows, producing the Selectable Models screenshots used in the
PR description. Matches the existing website/scripts/capture-*.mjs pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bobbyrc

bobbyrc commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Replies to the r128 hold, plus cruisercohen's non-blocking notes. This push also rebases onto af6246e1ae to clear a conflict with #23618: both sides added one import to dashboard/handlers/agents.py, and both are kept.

  • First Principles item 7 (kiro-cli rows are relabelled too): kept. The Goal is "each backend's own model names", and kiro-cli is one of those backends. The label is the name kiro-cli prints in --list-models, which /api/models already sent as display_name before this PR (fix: serve a kiro model under the model_id its session advertises #16569). The frontend just never read it. All ACP backends share one adapter (providers/adapters/acp.ts), so leaving displayName unset for kiro-cli would need a backend check inside it. The KAS bundle rows from feat(models): serve the KAS bundle picker from the engine model select #23618 come through the same mapping.
  • Opus note (None != {}): fixed. refresh_advertised_models now compares (_ADVERTISED_META.get(provider) or {}) != labels, so a backend whose rows carry no labels no longer re-persists provider_models.json on every session. test_label_less_rows_report_no_change_on_repeat fails without the fix and passes with it.
  • Design note (private _CLAUDE_CODE_PASSTHROUGH_ALIASES): made public. The set is now model_registry.CLAUDE_CODE_PASSTHROUGH_ALIASES, which agents_cc_model_rows.py reads. I didn't add a predicate. model_registry.py is at 1,600 lines, and a new function would take it past the split threshold.
  • cruisercohen, live switch: the description's Cache row now says the alias passthrough reaches every to_provider_id caller, including the in-chat live switch (dashboard/chat_api/slot_model.py).

Please don't use GitHub's Update branch button here: it adds a merge commit and reruns all of CI.

@iamwhatever

Copy link
Copy Markdown
Contributor

Holding on 547270c for one AI note on this head with no reply.

The three r128 items are settled: the None != {} re-persist is fixed (model_registry.py#L695) with a test, the alias set is public, and the kiro-cli relabel is kept for a sound reason. The range-diff from b7854dd shows only those fixes plus rebase context.

Unanswered: the First Principles lane on this head raises a new Item 2 note: _advertised_models_changed and _persist_advertised_models_if_changed duplicate client_model_selection.py:326-339, and having _feed_advertised_model_cache return the bool would remove the field, the method and its two bindings. Your earlier reply covered sharing the helper (the self: AcpClient mypy problem), not this return-value option. A short keep-with-reason or the subtraction clears this.

Checks on this head are green and no change request is active.

— crew-pr-reviewer (r131)

@iamwhatever iamwhatever 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.

Approving 547270c8cd6e3be91ca380873bcfd24d79f35fbd. Live and cached labels share one bounded admission, kiro create/load gain no call, the None != {} re-persist is fixed (model_registry.py#L695), and the bare-alias passthrough is limited to claude_code aliases the backend advertised (model_registry.py#L1060-L1092). bolichen97's change request was cleared by their own later approval, and CI is green.

AI findings judged non-blocking:

  • First Principles item 2 (persist flag duplicates client_model_selection.py): a duplication preference; the feed-then-persist pair is correct (session_handle_model_selection.py#L719-L732).
  • Design note (to_provider_id reads the cache): answered in your earlier reply; the first session/new overwrites the cache and a cold cache is main's behaviour.
  • Design note (reversed display-name test): informational; the description states the reversal for #21747.
  • UX note (chip shows the id): polish; the row's id hint keeps chip and checked row matching.

— crew-pr-reviewer (r132)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

4 participants