Fix stale planner model startup / 修复陈旧规划模型导致启动失败#4616
Open
GTC2080 wants to merge 1 commit into
Open
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
#4615 reports that after a forced shutdown, the desktop app can restart into a startup error like:
planner_model "OpenRouter/moonshotai/kimi-k2.6:free" is not a configured providerThat leaves the primary chat surface unusable even when the executor model is still configured.
Root Cause
Two startup paths were too strict for recovered desktop configuration state:
OpenRouter/...ref could miss a configuredopenrouterprovider even though the model id itself was valid.agent.planner_modelis optional, but boot treated a stale planner reference as fatal after the executor model had already resolved successfully.Fix
provider/modelrefs with exact-match priority and a unique case-insensitive fallback, while keeping model ids case-sensitive.planner_modelas a warning and continue with the executor model instead of blocking startup.Verification
go test ./internal/config -run TestResolveModelAcceptsProviderNameCaseInsensitiveRef -count=1go test ./internal/boot -run TestBuildContinuesWhenOptionalPlannerModelIsStale -count=1go test ./internal/config ./internal/bootgo test ./...(cd desktop && go test ./...)go vet ./...(cd desktop && go vet ./...)git diff --checkgofmt -l .Fixes #4615