Skip to content

agents: Codex tab never shows — account/read RPC exceeds 4s timeout (codex-cli 0.157), no local stats without ~/.codex/sessions #13880

Closed

Description

@AlexanderMavrov

System details

Intel i9-11900, Intel UHD 750 + NVIDIA GTX 960, Omarchy 4.0.4-1, codex-cli 0.157.0 (ChatGPT Plus login)

What's wrong?

The omarchy.agents bar widget never shows the Codex subscription, although codex is signed in and working. Only Claude appears.

~/.local/state/omarchy/agents/usage/codex.json always ends up as:

"limits": [], "totalPrompts": 0, "totalSessions": 0, "activeDays": 0,
"usageStatusText": "Codex limits unavailable", "authHelpText": "account/read"

so providerHasData() in Main.qml is false and the tab is hidden. There are two independent causes:

1. account/read exceeds the 4 s RPC timeout

fetch_codex_rpc() in bin/omarchy-agent-usage-codex sends account/read (timeout 4 s) before account/rateLimits/read. With codex-cli 0.157.0 the account/read response consistently takes ~31 s, and it blocks the following request too, so TimeoutError("account/read") is raised and no limits are recorded. The delay reproduces with a clean CODEX_HOME containing only auth.json, and network access to chatgpt.com is fine (~20 ms over IPv4).

Minimal repro (same calls as the collector, longer timeouts):

initialize            -> 0.1 s
account/read          -> 31 s
account/rateLimits/read -> 31 s (answered right after account/read)

Sending only account/rateLimits/read (skipping account/read) returns in ~0.9 s with primary/secondary windows and planType: "plus". Since plan already prefers limits.planType, dropping account/read (or making it optional / non-blocking) would fix the limits.

2. No local stats with current Codex session storage

~/.codex/sessions/ doesn't exist on this machine; current Codex (CLI + desktop app) keeps thread/rollout state in ~/.codex/state_5.sqlite (tables threads, rollout_migration_state, …). The collector only scans the native session files, so local stats are always zero, and the widget can't fall back to them either.

Expected: Codex tab appears with 5h/weekly limits (and ideally local token stats).

Steps to reproduce

  1. Sign in with codex login (ChatGPT account), codex-cli 0.157.0.
  2. Run omarchy-agent-usage-codex --force.
  3. Observe "limits": [] and "authHelpText": "account/read"; the widget shows only Claude.

Activity

  1. manuaudio commented on Sep 30, 2026

    @manuaudio
    Contributor

    Same root cause as #13158: the collector gives account/read 4s with no retry. Open PRs already address it, e.g. #13458 (raise the RPC timeout to 10s), #13650 (keep the last good limits when account/read times out) and #13464 (make account/read optional).

  2. AlexanderMavrov commented on Sep 30, 2026

    @AlexanderMavrov
    Author

    Thanks — agreed #1 is a duplicate of #13158. One data point for choosing between the PRs: here account/read takes ~31 s consistently (clean CODEX_HOME, codex-cli 0.157.0), so #13458's 10 s wouldn't be enough; #13464's ordering (rateLimits first, account/read optional) is what fixes it — rateLimits alone answers in ~0.9 s. Part #2 (no local stats because current Codex has no ~/.codex/sessions/, state lives in state_5.sqlite) isn't covered by those PRs, so I'll leave this open for that / happy to retitle it.

  3. jandrusk commented on Oct 1, 2026

    @jandrusk

    Agreed with the earlier comment: cause (1) is a duplicate of #13158.

    Given your measurement that account/read takes ~31s on codex-cli 0.157, #13458’s 10s bump alone is not enough — #13464 (rateLimits first, account/read optional) is the fix that would actually show the Codex tab here. Suggest consolidating discussion on #13158 / #13464 and closing this as a duplicate.

  4. omarchybot commented on Oct 4, 2026

    @omarchybot
    Collaborator

    The account/read dependency is fixed on quattro by #13733, retained by #14049. The separate request to derive local Codex usage from its SQLite state when no JSONL sessions exist has not landed. Keeping this report open for that local-statistics portion.

    Scope checked by GPT-6 in Codex and Codex Medium against the reports and landed source; independence is not guaranteed. No runtime tests were rerun for this reconciliation.

  5. omarchybot commented on Oct 26, 2026

    @omarchybot
    Collaborator

    Fixed by #14049 (merged Oct 3) with #13733: initialize and rate-limit reads get 8 s and account/read is optional, so the Codex tab shows without it. Checked by Claude Opus 5.5 against current quattro; no second-opinion review ran.

  6. manuaudio commented on Oct 26, 2026

    @manuaudio
    Contributor

    One part of this report is still unresolved. I checked current quattro at 4601078a7: bin/omarchy-agent-usage-codex still scans native Codex session files plus pi/omp/opencode, but it has no state_5.sqlite or SQLite path. #14049 fixed the account/read dependency and makes limits appear; it did not implement the local-statistics fallback Alexander kept this issue open for. Could you reopen this or split/retitle it for the missing state_5.sqlite usage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions