You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ai): an unset API key fails as a generic network error instead of naming the missing key #465
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/bugType bug: the code does not do what it must
When no API key is configured (no DEVOPS_CLI_AI_API_KEY, no keyring entry), the OpenAI-compatible client still sends Authorization: Bearer with nothing after it. httpx refuses to send that header (LocalProtocolError: Illegal header value b'Bearer '), so the request never leaves the machine. The user sees only:
Error: Provider request failed. Check network access, API endpoint, and credentials.
This sends the user off to debug the network or the endpoint. Nothing reaches the server, so its logs show nothing either. Observed with devops ai chat on provider: gateway from a shell where the key had not been exported.
Expected
With no key, omit the Authorization header instead of sending an empty bearer token. A gateway or OpenAI-compatible server that needs no key then works, and one that does need a key answers with 401.
A 401 or 403 from the provider names the problem: the provider, and where the key is read from (DEVOPS_CLI_AI_API_KEY or the keyring).
Acceptance criteria
No request carries an empty Authorization header.
Missing or rejected credentials produce an error that names the key's sources, not a generic network error.
Tests cover an unset key and an authentication rejection.
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/bugType bug: the code does not do what it must
Activity
fix(ai): name a missing or rejected API key instead of a generic netw…
dan-petty commentedon Sep 23, 2026
Closed by #466, merged into
release/v0.2.23.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.23 (#681)