Skip to content

Fix Codex usage widget: -a untrusted is no longer a valid approval policy - #7782

Closed
keithnyc wants to merge 1 commit into
omacom:quattrofrom
keithnyc:fix/codex-usage-approval-flag
Closed

keithnyc wants to merge 1 commit into
omacom:quattrofrom
keithnyc:fix/codex-usage-approval-flag

Conversation

@keithnyc

Copy link
Copy Markdown

Summary

  • omarchy-agent-usage-codex starts codex app-server with -a untrusted, but current codex-cli (0.149.0+) only accepts on-request or never for --ask-for-approval. The subprocess now exits immediately on this invalid flag instead of speaking the RPC protocol, so the script's initialize request times out after 8s and the Codex tab shows "Codex limits unavailable" with the raw TimeoutError text (initialize) as the help line. Local token stats are unaffected since they come from a separate file-scan path.
  • Switches the flag to -a never. Verified this is semantically correct, not just a value that happens to work: this process only calls the read-only account/read and account/rateLimits/read RPCs and never asks the model to run anything, so paired with -s read-only it makes the intent explicit — a fully non-interactive, read-only probe that can never block on an approval prompt.

Fixes #7781

Test plan

  • Reproduced the bug directly: codex -s read-only -a untrusted app-server fails with error: invalid value 'untrusted' for '--ask-for-approval <APPROVAL_POLICY>'
  • Verified the fix end-to-end: patched script run with -a never (and separately with -a on-request, for comparison) returns real rate limits (plan: plus, weekly window populated) instead of timing out
  • ./test/all — only pre-existing, environment-caused failures unrelated to this change (missing omarchy-pkgs checkout for config-test.sh/unowned-system-paths-test.sh, a permission bit on snapper-test.sh); confirmed these three also fail identically on quattro before this change

🤖 Generated with Claude Code

…licy

codex-cli dropped "untrusted" as an --ask-for-approval value, keeping only
on-request and never. The app-server subprocess omarchy-agent-usage-codex
spawns now exits immediately on this invalid flag, so the initialize RPC
never gets a reply and times out after 8s. The widget then shows "Codex
limits unavailable" with the raw TimeoutError text ("initialize") as the
help line, even though local token stats keep working fine via the
separate file-scan path.

Use "never": this process only calls the read-only account/read and
account/rateLimits/read RPCs, so it never needs to ask for approval.

Fixes omacom#7781
Copilot AI balanced review requested due to automatic review settings August 22, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@keithnyc

Copy link
Copy Markdown
Author

Closing as a duplicate — #7770 covers the same root cause (retired untrusted approval policy), was opened first, uses on-request with a better rationale, and adds a real regression test. Thanks for the faster fix!

@keithnyc keithnyc closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex usage widget always shows "Codex limits unavailable" (initialize timeout) with current codex-cli

2 participants