fix(settings): clear the OpenAI-compatible model cache under its provider id

CZ
1d ago
+51-7

Summary

Saving the OpenAI-compatible endpoint or API key is supposed to drop that provider's cached model list, but it cleared a vllm key the model picker never uses. The picker caches under the provider id openai_compatible, so after pointing nixmac at a different server it kept offering the old server's models.

 settings-dialog.tsx
   saveOpenaiCompatibleUrl / saveOpenaiCompatibleKey
-    tauriAPI.models.clearCached("vllm")
+    tauriAPI.models.clearCached("openai_compatible")

 ai-models-tab.tsx   (evolve and summary model fields)
   <form.Subscribe selector=[provider, openaiApiKey,
-    state.values.vllmApiBaseUrl]>              (never set, always undefined)
+    state.values.openaiCompatibleApiBaseUrl]>

Replaces the cache-fix half of #663, which targeted the stale develop branch; its local-path import half is not carried over.

#no-linear

Test Plan

  • New settings-dialog.test.tsx case calls both save handlers and expects clearCached("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 --noEmit in apps/native passes; oxlint reports no new warnings on the touched files
  • Manual: set an OpenAI-compatible endpoint, open the model picker, change the endpoint, and confirm the picker refetches

Docs

  • No docs update needed

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.

build will 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 vllm cache entry, but the picker caches under openai_compatible, so stale models stayed. The AI models tab also subscribed to a nonexistent vllmApiBaseUrl form value instead of openaiCompatibleApiBaseUrl, and the cache clears now go through the oRPC client. A regression test covers both save handlers.