Make login status recognize existing Codex authentication
On a fresh Codex Security state directory, codex-security login status reports Not logged in even when the existing Codex CLI session is authenticated. Running a scan imports the available credentials, after which the same status command succeeds.
Reproduction: authenticate with Codex, create a fresh Codex Security state directory, and run codex-security login status before the first scan.
Expected: the status command reflects usable existing Codex authentication without requiring a scan first.
Hi, I’d like to work on this issue. I’ll investigate how Codex Security discovers existing Codex authentication, identify why login status misses it on a fresh state directory, and add a fix with regression tests. I’ll share my plan ASAP. Please confirm before I start investigating and implementing a fix.
Welcome to Termux!
Docs: https://termux.dev/docs Donate: https://termux.dev/donate Community: https://termux.dev/community
Working with packages:
- Search: pkg search
- Install: pkg install
- Upgrade: pkg upgrade
Subscribing to additional repositories:
- Root: pkg install root-repo
- X11: pkg install x11-repo
For fixing any repository issues, try 'termux-change-repo' command.
Report issues at https://termux.dev/issues ~/cezar $ cd ~/cezar && codex doctor Codex Doctor v0.157.0 · linux-aarch64
Notes ✗ auth no Codex credentials were found - Run codex login or provide an API key through a supported auth env var. ⚠ updates update configuration is locally consistent ⚠ websocket Responses WebSocket failed; HTTPS fallback may still work - Check proxy, VPN, firewall, DNS, custom CA, and WebSocket policy support. ⚠ terminal width 71 cols - output may wrap (recommended >=80) ✗ reachability one or more required provider endpoints are unreachable over HTTP - Check proxy, VPN, firewall, DNS, and custom CA configuration. ─────────────────────────────────────────────────────────────
Environment ✓ system en-US os Linux [unknown bitness] OS language en-US LANG en_US.UTF-8 VISUAL not set EDITOR not set ✓ disk sufficient free disk space (19.1 GiB) warning threshold 5.0 GiB failure threshold 1.0 GiB CODEX_HOME available 19.1 GiB worktree available 19.1 GiB ✓ security endpoint protection is not inspected on this platform endpoint products not inspected on this platform ✓ runtime npm (package /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl, bin /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/bin, resources /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-resources, path /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-path) version 0.157.0 install method npm (package /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl, bin /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/bin, resources /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-resources, path /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-path) commit unknown executable /data/data/com.termux/fi…wn-linux-musl/bin/codex ✓ install consistent context npm (package /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl, bin /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/bin, resources /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-resources, path /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-path) managed by npm: yes · bun: no · pnpm: no · Vite+: no · package root /data/data/com.termux/files/usr/lib/node_modules/@openai/codex PATH entries (1) /data/data/com.termux/files/usr/bin/codex npm update target not inspected (PATH helpers are not executed) ✓ search file exists (bundled, /data/data/com.termux/files/usr/lib/node_modules/@openai/codex-linux-arm64/vendor/aarch64-unknown-linux-musl/codex-path/rg) search command /data/data/com.termux/fi…inux-musl/codex-path/rg search provider bundled search command readiness file exists ✓ git git executable found; execution not verified selected git /data/data/com.termux/files/usr/bin/git repo detected true repo root ~/cezar .git entry directory PATH entries (1) /data/data/com.termux/files/usr/bin/git git execution not inspected (PATH helpers are not executed) ⚠ terminal width 71 cols - output may wrap (recommended >=80) terminal unknown TERM xterm-256color stdin is terminal true stdout is terminal true stderr is terminal true ▸ terminal size 71x52 (expected >= 80 columns) color output enabled COLORTERM truecolor effective locale en_US.UTF-8 → resize the window to at least 80 columns ✓ title default · project cezar title source default title items activity, project-name activity item true project source git repo root project value cezar ✓ state state paths and databases are inspectable CODEX_HOME ~/.codex (dir) log dir ~/.codex/log (dir) sqlite home ~/.codex (dir) state DB ~/.codex/state_5.sqlite (missing) · integrity skipped (missing) log DB ~/.codex/logs_2.sqlite (missing) · integrity skipped (missing) goals DB ~/.codex/goals_1.sqlite (missing) · integrity skipped (missing) memories DB ~/.codex/memories_1.sqlite (missing) · integrity skipped (missing) active rollouts 0 files · 0 B (avg 0 B) archived rollouts 0 files · 0 B (avg 0 B) memories v2 DB ~/.codex/memories_v2_1.sqlite (missing) memories v2 DB integrity skipped (missing) queue DB ~/.codex/queue_1.sqlite (missing) queue DB integrity skipped (missing) thread history DB ~/.codex/thread_history_1.sqlite (missing) thread history DB integrity skipped (missing) ✓ threads no rollout/state DB inventory to compare default model provider openai rollout DB active files 0 rollout DB archived files 0 rollout DB scan errors 0 rollout DB malformed file names 0 rollout DB scan cap reached false rollout DB rows skipped (state DB missing)
Configuration
✓ config loaded
model
Updates ⚠ updates update configuration is locally consistent startup update check true update action npm install -g @openai/codex version cache ~/.codex/version.json version cache missing npm update target not inspected (PATH helpers are not executed) latest version probe version request timed out
Connectivity
✓ network no proxy env vars
proxy env vars none
respect system proxy disabled
managed proxy not configured
⚠ websocket Responses WebSocket failed; HTTPS fallback may still work — Check proxy, VPN, firewall, DNS, custom CA, and WebSocket policy support.
model provider openai
provider name OpenAI
wire API responses
supports websockets true
proxy env vars none
connect timeout 15000 ms
auth mode none
endpoint wss://api.openai.com/v1/
Background Server ○ app-server not running (ephemeral mode) daemon state dir ~/.codex/app-server-daemon settings ~/.codex/app-server-daemon/settings.json (missing) pid file ~/.codex/app-server-daemon/app-server.pid (missing) update-loop pid file ~/.codex/app-server-daem…/app-server-updater.pid (missing) dedicated pid file ~/.codex/app-server-daemon/daemon.pid (missing) dedicated update-loop pid file ~/.codex/app-server-daemon/daemon-updater.pid (missing) control socket ~/.codex/app-server-cont…app-server-control.sock status not running mode ephemeral
───────────────────────────────────────────────────────────── 15 ok · 1 idle · 5 notes · 3 warn · 2 fail failed
--summary compact output --all expand truncated lists --json redacted report ~/cezar $ cd ~/cezar && codex login Starting local login server on http://localhost:1455. If your browser did not open, navigate to this URL to authenticate:
https://auth.openai.com/oauth/authorize?response_type=code&client_id=app_EMoamEEZ73f0CkXaXp7hrann&redirect_uri=http%3A%2F%2Flocalhost%3A1455%2Fauth%2Fcallback&code_challenge=XKz_ITCRaOokkpK_2tqfJXLfKB-_9hpxALKOvM3Eppg&code_challenge_method=S256&state=kx2-KurJHSvkVe0AEcetkTxAZ06ei8UWbdUMbWkV5MU&scope=openid+profile+email+offline_access+api.connectors.read+api.connectors.invoke&id_token_add_organizations=true&codex_cli_simplified_flow=true&originator=codex_cli_rs
On a remote or headless machine? Use codex login --device-auth instead.