DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

Fix stale planner model startup / 修复陈旧规划模型导致启动失败

Open GTC2080 opened this issue 5 months ago • 0 comments

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 provider

That 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:

  • Model references matched the provider segment with exact casing only, so a recovered OpenRouter/... ref could miss a configured openrouter provider even though the model id itself was valid.
  • agent.planner_model is optional, but boot treated a stale planner reference as fatal after the executor model had already resolved successfully.

Fix

  • Resolve the provider segment of provider/model refs with exact-match priority and a unique case-insensitive fallback, while keeping model ids case-sensitive.
  • Treat an unresolved optional planner_model as a warning and continue with the executor model instead of blocking startup.
  • Add regression coverage for mixed-case OpenRouter refs and stale optional planner refs during boot.

Verification

  • go test ./internal/config -run TestResolveModelAcceptsProviderNameCaseInsensitiveRef -count=1
  • go test ./internal/boot -run TestBuildContinuesWhenOptionalPlannerModelIsStale -count=1
  • go test ./internal/config ./internal/boot
  • go test ./...
  • (cd desktop && go test ./...)
  • go vet ./...
  • (cd desktop && go vet ./...)
  • git diff --check
  • gofmt -l .

Fixes #4615

GTC2080 avatar Jun 16 '26 13:06 GTC2080