Skip to content

fix: prune removed models from enabled scope - #561

Open
y4ho0 wants to merge 1 commit into
agegr:mainfrom
y4ho0:agent/prune-stale-enabled-models
Open

fix: prune removed models from enabled scope#561
y4ho0 wants to merge 1 commit into
agegr:mainfrom
y4ho0:agent/prune-stale-enabled-models

Conversation

@y4ho0

@y4ho0 y4ho0 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prune stale canonical provider/modelId entries from global enabledModels when the model dialog removes those configured models
  • support exact entries with thinking-level suffixes while preserving globs, fuzzy or bare model ids, and unmatched future references
  • clear enabledModels when every exact entry was removed
  • invalidate the model-list cache after the settings update so stale warnings cannot be re-cached

Why

Saving the model dialog updated models.json but never updated settings.json. Exact enabled-model entries for a deleted connector therefore produced a persistent “No models match pattern” warning in every later session.

The cleanup compares the normalized configuration before and after the save. It only removes a canonical entry when that exact model existed in the old config and is absent from the new one. User-authored patterns that may target built-in or future models are left untouched.

Validation

  • focused model-config and pruning tests: 8 passed
  • full suite excluding the environment-dependent proxy test: 590 passed
  • changed-file ESLint and git diff --check: passed
  • the full suite’s sole failure is an HTTP proxy tunnel 502, reproduced unchanged on origin/main
  • TypeScript checking is currently blocked by the existing ThemeColor assertion in lib/rpc-manager.ts, also reproduced on origin/main

Closes #560

@y4ho0
y4ho0 marked this pull request as ready for review August 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model dialog doesn't clean up enabledModels in settings.json when a connector/models are removed → persistent 'No models match pattern' warnings

1 participant