Skip to content

Return 401 when ChatGPT OAuth credentials are not yet available - #25

Merged
bbrowning merged 1 commit into
mainfrom
chatgpt-401-when-login-required
Jul 17, 2026
Merged

Return 401 when ChatGPT OAuth credentials are not yet available#25
bbrowning merged 1 commit into
mainfrom
chatgpt-401-when-login-required

Conversation

@bbrowning

Copy link
Copy Markdown
Owner

Change Injector.Inject() to return InjectResult enum instead of bool, allowing injectors to distinguish "not ready" (401) from "failed" (502). ChatGPTInjector returns InjectAuthRequired when no tokens are loaded, giving the Codex CLI an actionable signal to trigger device-code login instead of retrying against a 502. Also broadens ChatGPT credential routing from /backend-api/codex to /backend-api to support additional endpoints like /backend-api/wham/usage.

Change Injector.Inject() to return InjectResult enum instead of bool,
allowing injectors to distinguish "not ready" (401) from "failed" (502).
ChatGPTInjector returns InjectAuthRequired when no tokens are loaded,
giving the Codex CLI an actionable signal to trigger device-code login
instead of retrying against a 502. Also broadens ChatGPT credential
routing from /backend-api/codex to /backend-api to support additional
endpoints like /backend-api/wham/usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning
bbrowning merged commit 8569dcd into main Jul 17, 2026
6 checks passed
@bbrowning
bbrowning deleted the chatgpt-401-when-login-required branch July 17, 2026 20:22
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