Repository navigation
π Normalize Claude model ids both ways between the claude and copilot backends - #19170
Conversation
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>
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
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. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
UI render evidenceRender evidence captured. Built from
These are fixture renders, not live data: the page was built from the PR head and filled with synthetic data from |
Fixes #19169 Signed-off-by: Andy Anderson <andy@clubanderson.com>
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>
|
[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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
Claude and Copilot serve the same Anthropic models under different naming conventions: the Claude CLI uses
claude-sonnet-5-5, the Copilot CLI usesclaude-sonnet-5.5. Each CLI rejects the other's spelling. Claude-backend agents ended up onclaude-sonnet-5.5and failed every kick ("There's an issue with the selected model"), while the agent's model dropdown showedclaude-sonnet-5-5as 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'smodelSelectOptionsHtml(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 norPUT /api/config/agent/{name}/modelsnormalized them.Changes
config.CanonicalizeModelForBackend(backend, id)(src/crux/config/model_id_conventions.go): on claude, dots become dashes; on copilot,claude-<family>-<major>-<minor>becomesclaude-<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.CanonicalizeCopilotModelfalls back to the same mapping for Claude ids its alias list does not know./api/model,PUT /api/config/agent/{name}/models(both return awarning), config load (Config.NormalizeModelIDConventions, with a per-agent dashboard warning and an overlay rewrite), the served claude and copilot model lists, and launch.Tests
Fixes #19169
π€ Generated with Claude Code