Skip to content

Codex usage collector passes removed '-a untrusted' flag, so limits never load #232

Open

Description

@andreivcodes

What happens

The Codex tab in the agents panel shows "Codex limits unavailable" with no plan
and no limit meters. Local token stats (tokens by day / by model) are correct —
only the limits and plan half is missing.

The written record looks like this:

{
  "usageStatusText": "Codex limits unavailable",
  "authHelpText": "initialize",
  "tierLabel": "",
  "limits": []
}

This is not an auth problem: ~/.codex/auth.json is valid and codex works
normally.

Cause

bin/omarchy-agent-usage-codex:531 starts the app-server with:

[codex, "-s", "read-only", "-a", "untrusted", "app-server"]

Current codex-cli no longer accepts untrusted as an --ask-for-approval
value. On codex-cli 0.149.1:

$ codex -s read-only -a untrusted app-server
error: invalid value 'untrusted' for '--ask-for-approval <APPROVAL_POLICY>'
  [possible values: on-request, never]

Codex exits with status 2 immediately. Because stderr is sent to DEVNULL
and Popen itself succeeds, the collector never notices — it waits on the
initialize RPC until the 8s timeout fires. The resulting TimeoutError
message is just the method name, which is why authHelpText reads
"initialize" rather than anything diagnostic.

Fix

Swapping untrusted for never restores the full chain — verified locally on
codex-cli 0.149.1, Arch Linux:

-      [codex, "-s", "read-only", "-a", "untrusted", "app-server"],
+      [codex, "-s", "read-only", "-a", "never", "app-server"],

account/read then returns the plan and account/rateLimits/read returns the
live windows, and the panel renders "Pro" with the weekly meter.

Dropping -a entirely also works and additionally surfaces the per-model
buckets in rateLimitsByLimitId (e.g. a 5h window for GPT-5.3-Codex-Spark),
though the collector only reads primary/secondary so the panel is
unaffected either way.

Possibly worth fixing alongside

Two things made this harder to diagnose than it needed to be:

  1. stderr=subprocess.DEVNULL on the app-server Popen swallows the actual
    CLI error. Capturing it and including it in authHelpText on failure would
    have named the problem immediately.
  2. A dead child is indistinguishable from a slow one — the collector burns the
    full 8s timeout on a process that already exited. A proc.poll() check on
    the timeout path (or a TimeoutError message that includes the exit status)
    would turn "initialize" into something actionable.

Environment

  • omarchy 4.0.1rc3-1 (Arch package; /usr/bin/omarchy-agent-usage-codex)
  • codex-cli 0.149.1
  • Arch Linux, Python 3

Activity

  1. andreivcodes commented on Aug 25, 2026

    @andreivcodes
    Author

    Follow-up: this is already fixed upstream, so this is a fork-sync issue rather
    than a new bug.

    basecamp/omarchy fixed it in 4cd8a08 — "Fix Codex usage collection on
    0.149 (omacom#7649)", 2026-08-25 — and their bin/omarchy-agent-usage-codex:531 now
    reads:

    [codex, "-s", "read-only", "-a", "on-request", "app-server"],

    Note they went with on-request rather than the never I suggested above.
    Either works for this call path — the collector only issues account/read and
    account/rateLimits/read and never executes anything, and -s read-only
    sandboxes it regardless — but matching upstream keeps the file identical across
    the sync.

    Upstream also tracked several reports of this (all closed as completed by that
    commit): omacom#7648, omacom#7781, omacom#7842, omacom#7873, omacom#7997, omacom#8032.

    So the fix here is just to pull 4cd8a08 into this fork. The two diagnostic
    suggestions in the original report still stand on their own if you want them —
    upstream's commit does not address either, so the next time the app-server CLI
    surface changes, this will fail the same silent way.

  2. added a commit that references this issue on Aug 27, 2026
    0aa13c1
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