Repository navigation
fix(settings): clear the OpenAI-compatible model cache under its provider id - #700
cooper (czxtm) wants to merge 2 commits into
Conversation
…ider id Saving the OpenAI-compatible endpoint or API key cleared the `vllm` model cache, but the model picker caches that provider's models under `openai_compatible`, so it kept listing the previous server's models. The AI models tab also subscribed to a nonexistent `vllmApiBaseUrl` form value instead of `openaiCompatibleApiBaseUrl`. First spotted in #663, which targeted develop; redone against main with a regression test.
[Low impact] The effects stay within OpenAI-compatible settings and model selection. The cache fix looks correct, but the touched calls must move to oRPC before merging to satisfy the repository guide. Findings
SummaryFixes OpenAI-compatible model cache clearing after saving an endpoint or API key.
Reviews (1) · Last reviewed commit: "fix(settings): clear the OpenAI-compatib..." · Reviewed by Greptile |
📋 PR Overview
🔬 Coverage
|
🎨 Storybook previewUpdated for 78d9040
|
…C client The native IPC guide asks callers of the deprecated ipc/api wrappers to move to oRPC when they are touched. The two clearCached calls this PR changed now call client.models.clearCached directly, and the test mocks @/lib/orpc to assert on that call.
|








Summary
Saving the OpenAI-compatible endpoint or API key is supposed to drop that provider's cached model list, but it cleared a
vllmkey the model picker never uses. The picker caches under the provider idopenai_compatible, so after pointing nixmac at a different server it kept offering the old server's models.Replaces the cache-fix half of #663, which targeted the stale
developbranch; its local-path import half is not carried over.#no-linear
Test Plan
settings-dialog.test.tsxcase calls both save handlers and expectsclearCached("openai_compatible")twice. Before the fix it fails with[["vllm"], ["vllm"]]; after, it passes.vitest run --project=unit src/components/widget/settings/settings-dialog.test.tsx: 3/3 pass (Node 22)tsc --noEmitinapps/nativepasses; oxlint reports no new warnings on the touched filesDocs
Merge Danger
Door: two-way. Four string changes and a test.
Blast Radius: Settings. Only the OpenAI-compatible provider's model cache and the AI models tab's re-render trigger are affected.
buildwill fail at notarization until the Apple Developer agreement is renewed, as on every PR right now.🤖 Generated with Claude Code
Summary by cubic
Fixes the OpenAI-compatible model cache so changing the endpoint or API key actually refreshes the model picker. Saving used to clear a
vllmcache entry, but the picker caches underopenai_compatible, so stale models stayed. The AI models tab also subscribed to a nonexistentvllmApiBaseUrlform value instead ofopenaiCompatibleApiBaseUrl, and the cache clears now go through the oRPC client. A regression test covers both save handlers.Written for commit 78d9040. Summary will update on new commits.