Skip to content

fix(server): remove deleted custom models - #5230

Open
CrovLune wants to merge 1 commit into
pingdotgg:mainfrom
CrovLune:crovlune/bugfix/remove-stale-custom-model
Open

fix(server): remove deleted custom models#5230
CrovLune wants to merge 1 commit into
pingdotgg:mainfrom
CrovLune:crovlune/bugfix/remove-stale-custom-model

Conversation

@CrovLune

@CrovLune CrovLune commented Aug 2, 2026

Copy link
Copy Markdown

What Changed

Deleting a custom provider model removed it from settings, but stale provider snapshots could add it back to the model picker and persist it again.

  • Treat the current settings-derived provider snapshot as authoritative for custom models during cache hydration.
  • Stop retaining missing custom models during live provider refreshes while preserving previously discovered non-custom models.
  • Add focused regression coverage for startup cache hydration and successful or incomplete provider refreshes.

Why

The cache hydration and live provider merge paths treated every missing model as provider-discovered inventory. That resilience is useful for non-custom models when a provider returns a partial snapshot, but it also resurrected user-configured models after deletion.

Custom models are configuration, so their absence from current settings must be authoritative. This keeps the existing fallback behavior for provider-discovered models without making custom-model deletion reversible by stale state.

Validation

  • vp test run apps/server/src/provider/providerStatusCache.test.ts apps/server/src/provider/Layers/ProviderRegistry.test.ts (51 tests passed)
  • Targeted vp lint on the four changed files
  • Targeted vp format --check on the four changed files
  • vp run --filter t3 --fail-if-no-match typecheck

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (not applicable: no UI changes)
  • I included a video for animation/interaction changes (not applicable: no animation or interaction changes)

Note

Remove deleted custom models from provider model retention logic

  • In ProviderRegistry.ts, mergeProviderModels now filters out custom models before retaining previously seen models during refresh, so deleted custom models are no longer re-added after a refresh cycle.
  • In providerStatusCache.ts, hydrateCachedProvider now treats current settings as the authority for custom models, skipping cached custom models not present in the fallback provider.
  • Behavioral Change: Custom models removed from settings will no longer reappear after a provider refresh or cache hydration.

Macroscope summarized 8f7bc1a.

Generated with gpt-5.6-sol via the Codex harness in T3 Code.


Note

Low Risk
Scoped to provider model merge/hydration logic with no auth or persistence schema changes; behavior change is intentional for user-configured models only.

Overview
Fixes a bug where custom models removed from settings could reappear in the model picker after a provider refresh or startup cache hydration.

Live refresh merging (mergeProviderModels in ProviderRegistry.ts) still keeps missing discovered models when a probe returns an empty or partial snapshot, but it no longer carries forward previous models marked isCustom. Successful refreshes that omit a deleted custom model therefore stay deleted.

Cache hydration (providerStatusCache.ts) treats the settings-derived fallback snapshot as authoritative for custom models: cached custom entries are not merged in unless they are already on the fallback list. Stale on-disk cache can still supplement non-custom discovered models.

Regression tests cover incomplete/successful Codex refreshes and hydration when cache still lists a removed custom model.

Reviewed by Cursor Bugbot for commit 8f7bc1a. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9650425f-0ce6-4ff2-9c5e-bd79c7a77ff6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 2, 2026
@CrovLune
CrovLune marked this pull request as ready for review August 2, 2026 12:00
@macroscopeapp

macroscopeapp Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 8f7bc1a

Straightforward bug fix that adds a simple filter to prevent deleted custom models from being retained during model merges. Changes are limited in scope, well-tested, and have clear intent.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant