Codex Desktop on a connected Child fails with "Missing environment variable: OPENCODEX_API_AUTH_TOKEN"; ocx connect reports only the CLI as ready
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Start with src/codex/desktop-switches.ts and trace how ocx connect configures the Child environment and reports readiness for Codex. Check the existing tests for client role behavior and Desktop authentication. Done means Codex Desktop can authenticate on a connected Windows Child, or the completion report clearly explains the required environment variable and supported setup.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Client or integration
Codex CLI
Area
CLI
Summary
On a Windows machine connected as a Child to a remote hub, ocx connect succeeds and the Codex CLI works, but Codex Desktop cannot authenticate: the injected provider table carries env_key = "OPENCODEX_API_AUTH_TOKEN", and only the npm launcher shim exports that variable. Codex Desktop spawns its own codex binary and never goes through the shim, so every Desktop turn fails with:
text
Copy
ERROR: Missing environment variable: OPENCODEX_API_AUTH_TOKEN.
What I expected: either ocx connect makes Codex Desktop work on a Child (as it does for the CLI), or it states that the variable must be set — the completion report only says Local Codex CLI: ready and says nothing about Desktop. The documented remedy for exactly this shape, --desktop-authless, is inert on a client: codexDesktopAuthless stays stored-but-ineffective with inertReason: "client_role" (src/codex/desktop-switches.ts), so there is no supported switch that avoids the manual variable.
Reproduction
-
Hub (Linux, tailnet bind):
runtimeRole=hub, hostname=, unauthenticatedLoopbackListener={enabled:true},
hub.managementIngress={enabled:true,port:10201}, hub.dataPublicOrigin=https://..ts.net:10003,
hub.managementPublicOrigin=https://..ts.net:10002 (published with tailscale serve)
ocx hub invite --json --clients codex -
Child (Windows 11), with the single-use code on stdin:
ocx connect https://..ts.net:10003 --management-url https://..ts.net:10002 --clients codex --pairing-code-stdin
-> "Connected to https://...:10003 as key ."
-> "Local Codex CLI: ready (it accepts every reasoning level in the installed catalog)."
-> "Codex autostart shim: installed and healthy" -
CLI works end to end:
codex exec "Responde exactamente y solo: OCX-OK" -> OCX-OK, provider opencodex, 200 on the hub -
Run the exact binary Codex Desktop spawns, with no OPENCODEX_API_AUTH_TOKEN in the environment:
& "$env:LOCALAPPDATA\OpenAI\Codex\bin<hash>\codex.exe" exec --skip-git-repo-check "hi"
-> ERROR: Missing environment variable:OPENCODEX_API_AUTH_TOKEN. (twice, one per attempt) -
Same command with the variable set from the client token file:
$env:OPENCODEX_API_AUTH_TOKEN = (Get-Content "$env:USERPROFILE.opencodex\service-api-token" -Raw).Trim()
-> answers correctly through the hub
Version
2.100.10 (latest; also unchanged on dev @ time of report)
Operating system
Child: Windows 11 24H2 (26200.x). Hub: Ubuntu, kernel 7.0.0-31-generic. Codex CLI runtime on the Child: 0.171.0-alpha.13 (AppData\Local\OpenAI\Codex\bin<hash>\codex.exe)
Provider and model
openai / gpt-6-sol (hub account pool, "forward" auth mode)
Logs or error output
ERROR: Missing environment variable: `OPENCODEX_API_AUTH_TOKEN`.
ERROR: Missing environment variable: `OPENCODEX_API_AUTH_TOKEN`.
ocx status (Child), while the above fails:
Codex autostart shim: wrapper shim present at ...\npm\codex.cmd
routing=opencodex-local, service=viable, shim=healthy
ocx connect status --json:
{"state":"connected", "readiness":"ready", "token":"owned", "selectedClients":["codex"]}
Screenshots and supporting files
No response
Redacted configuration
// Hub ~/.opencodex/config.json
{
"runtimeRole": "hub",
"hostname": "<tailnet-ip>",
"port": 10100,
"unauthenticatedLoopbackListener": { "enabled": true },
"hub": {
"dataPublicOrigin": "https://<hub>.<tailnet>.ts.net:10003",
"managementPublicOrigin": "https://<hub>.<tailnet>.ts.net:10002",
"managementIngress": { "enabled": true, "port": 10201 }
},
"corsAllowOrigins": ["http://localhost:10100"],
"defaultProvider": "openai"
}
# Child %USERPROFILE%\.codex\config.toml — written by ocx connect
model_provider = "opencodex"
[model_providers.opencodex]
name = "OpenCodex Proxy"
base_url = "https://<hub>.<tailnet>.ts.net:10003/v1"
wire_api = "responses"
requires_openai_auth = true
env_key = "OPENCODEX_API_AUTH_TOKEN"
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
- Lingua principale
- TypeScript
- Stelle
- 16.9k
- Fork
- 1.3k
- Merge medio
- 1g 4h
- PR unite (30g)
- 814
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lidge-jun/opencodex
-
bug gui platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
lidge-jun/opencodex#9172 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log lineForse già presa @EnesKartal l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lidge-jun/opencodex#9057 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersForse già presa @sedoll l’ha presa 6 giorni fa. Apertacatalog provider provider-compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
lidge-jun/opencodex#9037 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
account-pool enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
account-pool enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
lidge-jun/opencodex#9165 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lidge-jun/opencodex
Issue simili
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
ranxianglei/billion-context#7860 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
agent-oc-find-bugs api complexity → simple payment-methods recurring contributions reviewed stripe
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opencollective/opencollective#9177 ·