fix(desktop): codex OAuth onboarding resolves on fresh install#37506
Closed
teknium1 wants to merge 1 commit into
Closed
fix(desktop): codex OAuth onboarding resolves on fresh install#37506teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
The desktop codex device-code worker persisted tokens with a hand-rolled pool.add_entry(), writing only credential_pool.openai-codex. It never set active_provider, so on a fresh install the onboarding setup.runtime_check resolved provider "auto", couldn't detect the Codex OAuth session, and raised "No inference provider configured" — while setup.status (which sniffs the pool) reported configured. The disagreement surfaced as the onboarding banner "Connected, but Hermes still cannot resolve a usable provider." Use the canonical _save_codex_tokens() instead, matching the CLI's `hermes auth add openai-codex` path and the Nous/MiniMax dashboard workers. It writes the providers.openai-codex singleton (setting active_provider) and syncs the pool.
Contributor
🔎 Lint report:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the desktop app’s first-run OpenAI Codex (ChatGPT) OAuth onboarding so that a successful device-code login results in a resolvable runtime provider on fresh installs (by persisting via the canonical auth-store helper that sets active_provider).
Changes:
- Replace the hand-rolled
credential_pool.openai-codexwrite in the Codex device-code worker withhermes_cli.auth._save_codex_tokens(...). - Ensure the Codex login path sets the
providers.openai-codexsingleton (and thusactive_provider) to align dashboard onboarding with the CLI flow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3720
to
+3731
| # Persist via the canonical Codex token store. _save_codex_tokens writes | ||
| # the providers.openai-codex singleton (which sets active_provider via | ||
| # _save_provider_state) AND syncs the credential pool. The previous | ||
| # hand-rolled pool.add_entry() only seeded credential_pool.openai-codex, | ||
| # leaving active_provider=None — so on a fresh install the immediately- | ||
| # following setup.runtime_check resolved provider "auto", couldn't detect | ||
| # the Codex OAuth session, and raised "No inference provider configured" | ||
| # while setup.status (which sniffs the pool) reported configured. That | ||
| # divergence produced the desktop onboarding "Connected, but Hermes still | ||
| # cannot resolve a usable provider" error. This mirrors the CLI's | ||
| # `hermes auth add openai-codex` path and the Nous/MiniMax dashboard | ||
| # workers, which all use their canonical save helpers. |
Comment on lines
+3732
to
+3736
| from hermes_cli.auth import _save_codex_tokens | ||
| _save_codex_tokens({ | ||
| "access_token": access_token, | ||
| "refresh_token": refresh_token, | ||
| }) |
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.
Summary
Picking OpenAI Codex (ChatGPT) in the desktop app's first-run provider setup now resolves to a working provider instead of erroring out.
Root cause: the desktop codex device-code worker persisted tokens with a hand-rolled
pool.add_entry(), writing onlycredential_pool.openai-codex. It never setactive_provider. On a fresh install (no~/.hermes, no env keys) the onboarding flow immediately runssetup.runtime_check→resolve_runtime_provider("auto"), which detects OAuth providers only viaactive_provider— so it fell through and raised"No inference provider configured". Meanwhilesetup.status(which sniffs the pool) reported configured, producing the disagreement banner: "Connected, but Hermes still cannot resolve a usable provider."Changes
hermes_cli/web_server.py_codex_full_login_worker: persist via the canonical_save_codex_tokens()instead of a bare pool write. It writes theproviders.openai-codexsingleton (which setsactive_provider) and syncs the pool — matching the CLIhermes auth add openai-codexpath and the Nous (persist_nous_credentials) / MiniMax (_minimax_save_auth_state) dashboard workers, which were already correct.Validation
E2E on a fresh empty
HERMES_HOMEwith all provider env vars unset:active_providerafter codex OAuthNoneopenai-codexsetup.runtime_checkopenai-codexInfographic