Skip to content

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

Closed
CrovLune wants to merge 2 commits into
pingdotgg:mainfrom
CrovLune:crovlune/bugfix/remove-stale-custom-model
Closed

fix(server): remove deleted custom models#5230
CrovLune wants to merge 2 commits 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 15d0258.

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


Note

Medium Risk
Changes provider model merge semantics for custom vs discovered models; incorrect filtering could drop legitimate custom models or still resurrect deleted ones, but scope is limited to merge/hydration paths with targeted tests.

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

Live refresh merging (mergeProviderSnapshot in ProviderRegistry) still backfills missing discovered models when a probe returns a partial or empty list, but it no longer carries forward previous custom (isCustom) entries that are absent from the new snapshot.

Startup cache hydration (hydrateCachedProvider in providerStatusCache) still layers cached probe metadata and non-custom models onto the settings-derived fallback, but cached custom models are ignored so current settings define the custom model list.

Regression tests cover successful vs incomplete refreshes and cache hydration when the on-disk cache still lists a deleted custom model.

Reviewed by Cursor Bugbot for commit 15d0258. 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: 22e63b48-608e-458f-9493-aa4eb2a1380f

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

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.

@t3dotgg

t3dotgg commented Sep 3, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

Closing this because #9075 has merged. Live snapshot and boot-cache merges now drop custom models that are missing from current settings, which covers the stale server-cache case in this PR.

@t3dotgg t3dotgg closed this Sep 3, 2026
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.

2 participants