Skip to content

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

Open
GTC2080 wants to merge 1 commit into
esengine:main-v2from
GTC2080:GTC/fix-stale-planner-model-startup
Open

Fix stale planner model startup / 修复陈旧规划模型导致启动失败#4616
GTC2080 wants to merge 1 commit into
esengine:main-v2from
GTC2080:GTC/fix-stale-planner-model-startup

Conversation

@GTC2080

@GTC2080 GTC2080 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development config Configuration & setup (internal/config) labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 强制关机之后,重启应用就无法识别模型了

1 participant