Skip to content

fix(web): remove deleted custom models from picker - #4654

Closed
crosssawyer wants to merge 8 commits into
pingdotgg:mainfrom
crosssawyer:agent/remove-deleted-custom-models
Closed

fix(web): remove deleted custom models from picker#4654
crosssawyer wants to merge 8 commits into
pingdotgg:mainfrom
crosssawyer:agent/remove-deleted-custom-models

Conversation

@crosssawyer

@crosssawyer crosssawyer commented Jul 27, 2026

Copy link
Copy Markdown

What Changed

  • Treat current provider settings as the source of truth for custom-model membership in composer model options.
  • Continue using live provider snapshots for built-in models and metadata for custom models that are still configured.
  • Fall back to an available provider model when the active custom model is removed.
  • Add regression coverage for a stale provider snapshot that still contains the removed model.

Why

Provider snapshots refresh asynchronously after settings writes. The Settings page already removed a deleted custom model immediately, but the composer rebuilt its options from the stale snapshot and made that model selectable again.

User Impact

Removing a custom provider model now removes it from the composer immediately. If it was selected, the composer falls back to an available model instead of retaining the deleted selection.

Validation

  • vp test run apps/web/src/modelSelection.test.ts apps/web/src/components/settings/ProviderInstanceCard.test.ts (13 tests)
  • vp fmt --check apps/web/src/modelSelection.ts apps/web/src/modelSelection.test.ts
  • vp lint apps/web/src/modelSelection.ts apps/web/src/modelSelection.test.ts --report-unused-disable-directives
  • vp run --filter @t3tools/web typecheck
  • Integrated web verification: added and selected a temporary Claude model, removed it in Settings, then confirmed the composer fell back and the removed model was absent from the open picker

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots are not applicable because this changes model-list state, not visual styling
  • A video is not applicable because this does not change motion or animation

Note

Remove deleted custom models from the model picker

  • getAppModelOptionsForInstance and getAppModelOptions now exclude custom models from the provider snapshot unless the instance/user's configured customModels explicitly includes the slug, preventing deleted models from appearing in the picker.
  • When a configured slug matches a live custom model in the snapshot, the live provider metadata is used; otherwise a minimal stub is shown.
  • resolveAppModelSelectionForInstance fallbacks now skip custom models entirely, returning the first non-custom default or null.
  • Behavioral Change: users with a stale provider snapshot referencing a removed custom model will no longer see or fall back to that model.

Macroscope summarized dc76b9d.


Note

Low Risk
Scoped to composer model-picker and selection resolution; no auth or persistence changes beyond aligning UI with settings as source of truth for custom models.

Overview
Fixes a race where the composer rebuilt model options from a stale provider snapshot after Settings removed a custom model, so deleted models could reappear and stay selected.

Model option lists (getAppModelOptions / getAppModelOptionsForInstance) now take built-in models from the live snapshot but only add custom models whose slugs are still in instance customModels settings. Custom entries on the snapshot alone are no longer merged into the picker. When a configured slug still exists on the snapshot, provider metadata is used; otherwise a minimal custom stub is shown.

Selection fallback in resolveAppModelSelectionForInstance no longer picks default/first custom models from entry.models when the active choice is invalid—only non-custom defaults remain as fallbacks, or null when nothing else is available.

Regression tests cover stale snapshots that still list a removed custom model while settings has an empty customModels list.

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

@coderabbitai

coderabbitai Bot commented Jul 27, 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: c695c599-2928-4514-b447-b628da1a6d2c

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 27, 2026
@crosssawyer
crosssawyer marked this pull request as ready for review July 27, 2026 16:06

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6f1d011. Configure here.

Comment thread apps/web/src/modelSelection.ts
@macroscopeapp

macroscopeapp Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This is a straightforward bug fix that filters out deleted custom models from the picker when server cache is stale. Changes are limited to model selection logic with clear test coverage, no runtime behavior impact beyond fixing the display bug.

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. The web picker now builds custom-model membership from current settings instead of stale snapshots, and normal selection falls back to an available model.

@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:M 30-99 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