The best way to control Claude Code, Codex and more from any computer or phone
refactor(web): provider models keep their caching without "use memo" (#20775)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 23:26 UTC
275e7de026e62cdb0aea107fd6a31334e1e15b57
1 file changed
+6
-9
apps/web/src/components/settings/ProviderModelsSection.tsx
+6
-9
@@ -113,12 +113,6 @@ interface ProviderModelsSectionProps {
113
readonly onModelOrderChange: (next: ReadonlyArray<string>) => void;
114
}
115
116
-/** CustomModelEditor keys its option list on this array. */
117
-function useBuiltInModels(models: ReadonlyArray<ServerProviderModel>) {
118
- "use memo";
119
- return models.filter((model) => !model.isCustom);
120
-}
121
-
116
export function ProviderModelsSection({
117
instanceId,
118
driverKind,
@@ -153,9 +147,6 @@ export function ProviderModelsSection({
147
const hiddenCount = displayModels.filter(
148
(model) => !model.isCustom && hiddenModelSet.has(model.slug),
149
).length;
156
- const builtInModels = useBuiltInModels(models);
157
- const allBuiltInModelsHidden =
158
- builtInModels.length > 0 && builtInModels.every((model) => hiddenModelSet.has(model.slug));
150
const showFilter = models.length > FILTER_THRESHOLD;
151
const normalizedFilter = filter.trim().toLowerCase();
152
const isFiltering = showFilter && normalizedFilter.length > 0;
@@ -179,6 +170,12 @@ export function ProviderModelsSection({
170
row.scrollIntoView({ block: "nearest" });
171
});
172
173
+ // CustomModelEditor keys its option list on this array. Derived after the effect and
174
+ // checked against `hiddenModels` rather than the set built above it, so it stays cached.
175
+ const builtInModels = models.filter((model) => !model.isCustom);
176
+ const allBuiltInModelsHidden =
177
+ builtInModels.length > 0 && builtInModels.every((model) => hiddenModels.includes(model.slug));
178
+
179
const handleAdd = () => {
180
if (!canManageCustomModels || driverKind === "antigravity") return;
181
const normalized = normalizeCustomModelSlug(input);