This repository was archived by the owner on May 9, 2026. It is now read-only.
feat: agent 0.12.11 (auto-heal cross-provider model orphans)#93
Merged
Conversation
ee968f8 to
1a0372b
Compare
Flipping `provider` from one service to another (e.g. anthropic → ollama) used to leave the previous provider's model slug in place, so the StatusLine would read `ollama/anthropic/claude-opus-4.7` and every cycle would explode trying to ask ollama to serve an openrouter-shaped slug. `normalizeModelForProvider()` now recognises known openrouter vendor prefixes plus bare claude-/gpt-/gemini-/o1- families, and when the slug clearly belongs to a different provider than the one now selected it resets to that provider's default. `saveConfig()` also runs this normalisation at write time so the on-disk file never sits in a broken cross-provider state. New scripts/smoke-normalize-model.mjs round-trips the fix against a scratch HOME and sweeps the pure-function cases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1a0372b to
93ebd3a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
providerfrom one service to another (e.g. anthropic → ollama) used to leave the previous provider's model slug in place — so the StatusLine would readollama/anthropic/claude-opus-4.7and every heartbeat would explode asking ollama to serve an openrouter-shaped slug.normalizeModelForProvider()in src/config.ts now recognises known openrouter vendor prefixes (anthropic/,openai/,google/,meta-llama/,moonshotai/,deepseek/,mistralai/,minimax/,cohere/,microsoft/,perplexity/,x-ai/,qwen/) plus bareclaude-/gpt-/gemini-/o1-families. When the slug clearly belongs to a different provider than the one now selected it resets to that provider's default (claude-opus-4-7/gpt-4o/gemini-2.5-pro/anthropic/claude-opus-4.7/llama3.3). Users can still pick a specific model from the/keysdropdown afterward.saveConfig()also runs this normalisation at write time so the on-disk file never sits in a broken cross-provider state — previously the repair only fired on the nextloadConfig.scripts/smoke-normalize-model.mjsround-trips the fix against a scratch$HOMEand sweeps pure-function cases for each provider (23 assertions).Test plan
pnpm run typecheckcleanpnpm run buildcleannode scripts/smoke-normalize-model.mjs— 23/23 assertions passconfig.jsonwith{provider: ollama, model: anthropic/claude-opus-4.7}, runkrawler status→ StatusLine readsollama / llama3.3, on-disk file rewritten to match🤖 Generated with Claude Code