Skip to content

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

Open
cooper (czxtm) wants to merge 2 commits into
mainfrom
fix/openai-compatible-model-cache
Open

cooper (czxtm) wants to merge 2 commits into
mainfrom
fix/openai-compatible-model-cache

Conversation

@czxtm

@czxtm cooper (czxtm) commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

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.

Written for commit 78d9040. Summary will update on new commits.

View guided diff Turn on auto-fix

…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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Save handlers retain deprecated calls ▶

Summary

Fixes OpenAI-compatible model cache clearing after saving an endpoint or API key.

  • Saving OpenAI-compatible settings clears the model cache the picker uses.
  • Both AI model fields follow the OpenAI-compatible endpoint setting.

Reviews (1) · Last reviewed commit: "fix(settings): clear the OpenAI-compatib..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📋 PR Overview

Lines changed 58 (+51 / -7)
Files 0 added, 3 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
Linear issue no
No Test Plan Needed no
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 35.1% 34.5% 30.1% 29.6%

Generated by 🚫 dangerJS against 78d9040

@darkmatter

darkmatter Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🎨 Storybook preview

Open Storybook preview

Updated for 78d9040


⚠️ Detected UI changes (5)

These stories' HTML snapshots changed. I've added screenshots + links to the changed stories below. Review them carefully then accept the changes to regenerate baselines and include them in this PR:

Flows/Evolve › Playground

Flows/Evolve › Playground

Flows/Evolve › 1. Begin (idle)

Flows/Evolve › 1. Begin (idle)

Flows/Evolve › 2. Evolving (progress)

Flows/Evolve › 2. Evolving (progress)

Flows/Evolve › Evolving With Error Event

Flows/Evolve › Evolving With Error Event

Flows/Evolve › 3. Review (changes generated)

Flows/Evolve › 3. Review (changes generated)


Accept UI changes

  • Click here to accept these changes

Alternatively, you can run bun run test:update-snapshots locally to re-generate the baselines and then push the changes to this PR.

What does this do?

The screenshots above show UI changes detected by the Storybook
snapshot tests run on this PR. Each image is the rendered output of
a Storybook story from the code in this PR branch; the snapshot
test compared it against the committed baseline in
__snapshots__/ and flagged the difference.

Checking the box tells the darkmatter[bot] to regenerate the
baselines from this PR's current code and commit them directly to
this branch. The new baselines become the source of truth for
future runs — only accept after confirming the visual changes are
intentional.

Comparison baseline: the committed __snapshots__/ files on this
PR branch (carried forward from develop). Accept updates them in
place on this branch.

…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.
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

This branch was successfully deployed

1 active deployment
storybook-preview — 78d90409 Deployed Nov 9, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant