Repository navigation
provider: skip disabled keys when refreshing the model list - #76
Merged
Merged
Conversation
… treated len(allKeys()) > 1 as "ask every saved key", and allKeys() includes the KeyAccount entries marked Off, so a disabled or expired key was called on every refresh and its list merged into the catalog, where a text-only answer could take image input off a model a key that is on serves; the live fetch path now uses KeysOn(), off keys get no requests and add nothing to the catalog, and turning a key back on includes it on the next refresh, covered by TestOffKeyIsNotFetched
yetone
added a commit
that referenced
this pull request
Sep 25, 2026
… which models a key sees is known only from its own list, and since #76 an off key's isn't asked, so a key turned back on (or a new one) waited for the next Refresh: a relay that hands out a key per group sent it nothing, or every model; and a Codex reasoning item whose content is null is kept for OpenAI like one without content (#75 dropped it as malformed)
Owner
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.
A key marked Off still gets called during model-list refresh, and its models show up in the picker. A disabled or expired key hits the network on every refresh. If it lists the same model as a key that is on, and says that model has fewer capabilities (for example no image input), the merged entry loses those capabilities for the active key too.
Root cause: Provider.Fetch treated len(allKeys()) > 1 as "ask every saved key". allKeys() includes KeyAccount entries with Off: true, and fetchPerKey then requests and merges those lists. KeysOn() already omits off keys.
Fix: the live fetch path uses KeysOn(). Off keys receive no requests and add nothing to the catalog. Turning a key back on includes it on the next refresh. TestOffKeyIsNotFetched covers two keys against an httptest server: zero requests and no models or capability changes while the key is off, then the key's models return after it is enabled.
go vet ./internal/provider/ ./internal/catalog/ and go test ./internal/provider/ pass.