Skip to content

πŸ› Normalize Claude model ids both ways between the claude and copilot backends - #19170

Merged
kubestellar-prow[bot] merged 3 commits into
v5from
fix/claude-dotted-model-id
Nov 18, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
v5from
fix/claude-dotted-model-id

Conversation

@clubanderson

@clubanderson clubanderson commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Claude and Copilot serve the same Anthropic models under different naming conventions: the Claude CLI uses claude-sonnet-5-5, the Copilot CLI uses claude-sonnet-5.5. Each CLI rejects the other's spelling. Claude-backend agents ended up on claude-sonnet-5.5 and failed every kick ("There's an issue with the selected model"), while the agent's model dropdown showed claude-sonnet-5-5 as selected.

Root cause

  • handleSwitch (POST /api/switch/{agent}/{backend}, src/pkg/dashboard/api_agent_control.go) changes only the backend, so an agent switched between copilot and claude keeps the other CLI's spelling. The audit log on the affected hive shows exactly this (copilot to claude).
  • modelOptionsHtml (src/pkg/dashboard/static-src/js/backends-tokens.js) preselects with _modelIdMatches, and the Settings dialog's modelSelectOptionsHtml (linear-repos-save.js) with _modelsEqual. Both fold dotted and dashed versions together, so a stored wrong-convention id preselected the valid option and the bad value was hidden. Auto-heal used the same match and never repaired it.
  • normalizeModelNameForBackend (src/crux/agent/manager_routing.go) passed claude ids through verbatim, and neither the config loader nor PUT /api/config/agent/{name}/models normalized them.

Changes

  • One shared mapping, config.CanonicalizeModelForBackend(backend, id) (src/crux/config/model_id_conventions.go): on claude, dots become dashes; on copilot, claude-<family>-<major>-<minor> becomes claude-<family>-<major>.<minor>. Bare generations (claude-opus-5), dated ids, non-Claude ids (gpt-*, gemini-*, auto), gateway ids (anthropic/...) and other backends pass through. crux.CanonicalizeCopilotModel falls back to the same mapping for Claude ids its alias list does not know.
  • Used on the backend switch (live override and both config layers, before the restart), /api/model, PUT /api/config/agent/{name}/models (both return a warning), config load (Config.NormalizeModelIDConventions, with a per-agent dashboard warning and an overlay rewrite), the served claude and copilot model lists, and launch.
  • Both dropdowns match strictly on claude and copilot: a stored wrong-convention id is shown as stored with "not valid for ; pick ". Other backends keep the tolerant match. Switch and model toasts show the server warning.

Tests

  • src/crux/config/model_id_conventions_test.go (both directions, pass-through, round trip)
  • src/crux/copilot_models_test.go, src/crux/agent/routing_coverage_test.go (launch, both directions)
  • src/pkg/config/model_id_conventions_test.go (loader, both directions)
  • src/pkg/dashboard/api_model_id_conventions_test.go (switch to claude and to copilot, valid and non-Claude ids kept, Settings models endpoint, boot surfacing, served lists, Settings dialog picker)
  • src/pkg/dashboard/model_id_convention_dropdown.test.js (action-bar dropdown, both directions)

Fixes #19169

πŸ€– Generated with Claude Code

Switching an agent from copilot to claude kept the copilot spelling of its
model (claude-sonnet-5.5), which the Claude CLI rejects on every kick, and
the model dropdown's dotted/dashed folding preselected claude-sonnet-5-5 so
the stored value looked fine.

Add config.CanonicalizeClaudeModel and apply it on the backend switch, the
model set and Settings model endpoints, config load (with a dashboard
warning and an overlay rewrite), the served claude model list and launch.
The claude dropdown now matches ids strictly and flags a stored dotted id
as not valid for claude.

Fixes #19169

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • relative links and anchors resolve

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#19143 πŸ› Reviewer-stated rules: ignore quotes and questions, match more future phrasings, and give the preferences a Settings card same files src/docs/api-reference/auth.md
src/docs/api-reference/configuration.md
src/pkg/config/config.go
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html
#19063 ✨ PR gate: fail visibly when the Commit statuses grant is missing CONFLICT src/docs/api-reference/auth.md (conflict)
src/docs/api-reference/dashboard-misc.md
src/docs/api-reference/health-status-events.md (conflict)
src/docs/api-reference/snapshots-and-style.md (conflict)
src/pkg/dashboard/static/index.html
#19172 ✨ sidecar: knowledge advise callback so sidecar runtimes get the mid-task adviser (default off) CONFLICT src/docs/api-reference/knowledge.md (conflict)
src/pkg/dashboard/static/index.html

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

UI render evidence

Render evidence captured.

Built from 6fa7c42c309b.
Screenshots: download the artifact (sign-in to GitHub required).
Run: https://github.com/hivecommons/hive/actions/runs/44421373269

Page Section Viewport Theme File Size
hive overview desktop light hive-overview-desktop-light.png 313 KB
hive overview desktop dark hive-overview-desktop-dark.png 307 KB
hive overview phone light hive-overview-phone-light.png 467 KB
hive overview phone dark hive-overview-phone-dark.png 464 KB
hub-fleet overview desktop light hub-fleet-overview-desktop-light.png 113 KB
hub-fleet overview desktop dark hub-fleet-overview-desktop-dark.png 115 KB
hub-fleet overview phone light hub-fleet-overview-phone-light.png 265 KB
hub-fleet overview phone dark hub-fleet-overview-phone-dark.png 270 KB
hub-dashboard overview desktop light hub-dashboard-overview-desktop-light.png 338 KB
hub-dashboard overview desktop dark hub-dashboard-overview-desktop-dark.png 344 KB
hub-dashboard overview phone light hub-dashboard-overview-phone-light.png 624 KB
hub-dashboard overview phone dark hub-dashboard-overview-phone-dark.png 656 KB

These are fixture renders, not live data: the page was built from the PR head and filled with synthetic data from src/scripts/fixtures/render-evidence/. They show layout and theming, not how real hives behave. How to read them: src/docs/ui-render-evidence.md.

Fixes #19169

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 18, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
Claude and Copilot serve the same Anthropic models under different naming
conventions (claude-sonnet-5-5 vs claude-sonnet-5.5) and each CLI rejects
the other's spelling. Replace the claude-only rewrite with one shared
mapping, config.CanonicalizeModelForBackend, used for both backends: the
backend switch, model set, Settings models endpoint, config load, served
model lists, launch and crux.CanonicalizeCopilotModel. Non-Claude ids and
other backends pass through.

Both model dropdowns (agent action bar and Settings dialog) now match
strictly on claude and copilot, show a wrong-convention stored id as stored
and flag it with the id to pick.

Fixes #19169

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson clubanderson changed the title πŸ› Normalize Copilot-spelled Claude model ids for the claude backend πŸ› Normalize Claude model ids both ways between the claude and copilot backends Nov 18, 2026
@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 37b0f4a into v5 Nov 18, 2026
105 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/claude-dotted-model-id branch November 18, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› Copilot-spelled claude-sonnet-5.5 carried onto claude-backend agents and hidden by the model dropdown

1 participant