Repository navigation
fix(llm): empty key reads missing for catalog providers without adapter - #35
Merged
Merged
Conversation
- catalog branch of auth index: empty secret from env-backed store no longer counts as key - lookup order aligned with kit: store, then env, non-empty only; env read even without env-backed store - provider show, model list guidance and run precheck agree on unset / empty / whitespace / set - matrix test: built-in, protocol-routed catalog, adapterless catalog x env / store / LLM_API_KEY / llm.yaml api_key / api_key_env - e2e: fixturecompat routed provider in fixture catalog; empty-key show + exit 5 run cases - docs: empty value is no key; whitespace sent as written
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.
An empty key reads as missing for every provider in
foo provider showandfoo model list.Bug
internal/llm/auth.goresolveCatalogAuth(catalog providers no kit adapter serves) acceptedstore.Get(...)when the result was non-nil, without checking the value. foo's defaultenvsecret backend usesos.LookupEnv, so a variable set to""returned an empty secret and the provider showedconfigured. Providers kit serves (built-ins, protocol-routed catalog providers) were already right: kit skips empty values for every source.Fix
lookupCatalogKey, same rule as kit: secret store first, then the environment; only a non-empty value counts. ReusesnamedStore, so "empty is missing" lives in one place.missing; they now fall back to the environment, as kit does.LLM_API_KEYandllm.yamlstill never apply to adapterless providers (kit won't lend a key to a provider no run can reach).Tests
internal/llm/emptykey_test.go: 3 provider kinds (openai;fixturecompat, protocol-routed;fixturecloud, no adapter) × 7 sources × 4 key states;provider showstatus,model listvisibility and the run precheck (exit 5) agree. Plus: an empty key doesn't count toward the "configured providers" hint.fixturecompat;TestCLI_Provideradds empty-keyshowcases for all three and empty-key runs (openai://gpt-4o,fixturecompat://compat-1) that must exit 5.Docs
commands.md(provider show),config.md(key precedence): empty is no key, spaces are sent as written, adapterless catalog providers look up only the catalog's variables (store, then env).