Windows desktop WSL backend fails to refresh authentication when CODEX_REFRESH_TOKEN_URL_OVERRIDE is empty

Aperta Adatta ai principianti
#61,634 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia in codex-rs/login/src/auth/manager.rs, dove viene scelto l'endpoint di refresh: l'override viene preso ogni volta che la variabile esiste, quindi controlla se la lettura distingue assente da presente ma vuota e tratta un valore vuoto come non impostato. Conferma che il percorso di fallback usa ancora l'endpoint di autenticazione predefinito e aggiungi un unit test che copra un CODEX_REFRESH_TOKEN_URL_OVERRIDE vuoto accanto ai test di override esistenti. Fatto significa che il refresh riesce con la variabile vuota, in linea con il workaround WSL nel report; la correzione di inoltro lato launcher è una modifica separata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

app auth bug windows-os

Summary

The Windows desktop app becomes stuck on “Failed to load account information” when its WSL backend inherits an empty CODEX_REFRESH_TOKEN_URL_OVERRIDE and needs to refresh saved authentication.

On the affected installation, removing only this empty override from the backend environment, while keeping the working proxy configuration unchanged, allowed authentication to refresh automatically and restored the desktop UI.

Environment

  • Microsoft Store package: OpenAI.Codex 26.1111.2228.0 (package version, not the About-dialog version).
  • Windows 11, x64.
  • Backend: WSL2, Ubuntu 26.04.
  • Authentication: ChatGPT sign-in.
  • HTTP/HTTPS proxy configured in the WSL login-shell environment.

Observed behavior

The web app worked, but the Windows desktop app displayed:

Failed to load account information. Please check your network connection and try again.

Inspection of the actual desktop-launched WSL backend showed:

CODEX_REFRESH_TOKEN_URL_OVERRIDE=
HTTP_PROXY=http://127.0.0.1:7897
HTTPS_PROXY=http://127.0.0.1:7897

The override was present with an empty value, rather than absent. The backend's WSLENV also included its name. Static inspection of the installed desktop launcher found that it adds this authentication override to the WSL forwarding list.

Selected log fields before the workaround:

2026-11-15T10:30:20.067Z durationMs=475 errorCode=-32603 method=account/read
2026-11-15T10:31:46Z ERROR codex_login::auth::manager Failed to refresh token: builder error

Adding the WSL proxy variables and restarting did not resolve the account-loading failure. The backend had the proxy values, and an unauthenticated request to the authentication service through that proxy returned HTTP 200, but token refresh still failed with builder error.

Trigger conditions / reproduction

  1. Use the Windows desktop app with its backend configured to run in WSL.
  2. Have saved ChatGPT authentication that needs refreshing.
  3. Launch the backend with CODEX_REFRESH_TOKEN_URL_OVERRIDE present but empty.
  4. Observe token-refresh failures and the account-loading error screen.

These conditions were observed on the affected installation; the successful recovery below used the existing credentials.

Workaround and recovery

Add this to the WSL login-shell profile used by the desktop launcher:

if [ -z "${CODEX_REFRESH_TOKEN_URL_OVERRIDE-}" ]; then
    unset CODEX_REFRESH_TOKEN_URL_OVERRIDE
fi

After restarting the desktop app:

  • The actual backend no longer had the empty override.
  • The proxy settings were unchanged.
  • Saved authentication refreshed automatically.
  • account/read succeeded.
  • The normal desktop UI and conversation history loaded.

Selected log fields after the workaround:

2026-11-15T10:31:55.835Z durationMs=4 errorCode=null method=account/read

Expected behavior / suspected cause

An empty optional refresh-endpoint override should behave as unconfigured and fall back to the normal authentication endpoint.

The refresh endpoint selection code uses the override whenever the environment variable exists, without filtering empty strings. This is consistent with constructing a refresh request using an empty URL and reporting builder error.

Please consider ignoring blank override values in endpoint selection and avoiding forwarding unset optional overrides as empty values in the Windows-to-WSL launcher.

Related symptom report: #61123. This report identifies a specific empty-override failure; it does not establish that the related report has the same cause.

Lingua principale
Rust
Stelle
135k
Fork
21.4k
Merge medio
1m
PR unite (30g)
998

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/codex

Tutte le issue di openai/codex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.