Repository navigation
fix(app): list every provider added on this computer on v2 - #6472
Merged
Merged
Conversation
…on v2 With localProviderMirror on, a second key saved in AI Providers reached the model picker but never appeared under On this device. AI Providers lists providers from OpenCode v1, which caches them per folder. The server meant to refresh that cache after each save by reloading the folder through the engine pool, but the pool skips a folder already reloaded onto the same config file, and saved credentials are not in that file, so every save after the first was skipped. - The server disposes v1's instance for the folder in place after a key save, removal or provider sign-in on v2, bypassing the pool's config fingerprint. It never spawns an engine and never runs while v1 has work, so it cannot bring back reload storms. - AI Providers reconciles v1's list with the engine's status: a provider the engine mirrored is listed as Ready to use and a skipped one with its reason, even when v1's list has not caught up. - The proof now saves two keys in sequence and checks both in AI Providers and in the picker. Signed-off-by: Benjamin Shafii <benjamin.shafii@gmail.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
OpenWork evidence
Run details · Open the preview to inspect evidence and sandbox options. |
Contributor
There was a problem hiding this comment.
Warden clearance. Complete security and confidentiality review of 434bd658dfc3f808d5bfb14aaba25fd0bad126cd found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run
Contributor
Warden: approvedNo high or medium security findings and no confidentiality findings. Reviewed |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this about?
With
localProviderMirroron and chat on OpenCode v2, every key added in AI Providers now appears under "On this device", not only the first.What problem does it solve?
A second key (Anthropic after OpenRouter, or OpenAI after Anthropic) reached the model picker but was missing from AI Providers, so Settings and chat disagreed.
What was the situation before?
After saving the second key, "On this device" still listed only the first provider until a restart, while the picker already had the new provider's models.
How is this implemented?
apps/server/src/server.ts: after a key save, removal or provider sign-in on v2, dispose v1's instance for that folder in place, bypassing the pool's fingerprint. It never spawns an engine and never runs while v1 has work, so the reload storms fix(app): stop engine-switch request storms; guide chat migration #5506/perf(models): show providers without waiting on the engine's cold start #5529 removed can't come back. SamelocalProviderMirrorgate as before.local-provider-engine-state.ts: "On this device" reconciles v1's list with the engine status. Mirrored providers read Ready to use and skipped ones keep their reason, even when v1's list lags.What else changed?
Release note
On the new engine, AI Providers lists every API key you add on your computer, not just the first one.
Evidence
evals/proofs/v2-local-provider-mirror.proof.test.tsnow saves two keys in sequence. Before: the Anthropic row never appears (fails on dev). After: both are Ready to use and both are in the picker.Design: P1, P4, P11