Repository navigation
Fix Codex usage collector with current app-server - #7829
BestSithInEU wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Codex usage collection for current CLI and app-server responses.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Uses the supported
neverapproval policy. - Prefers Codex-specific limits with legacy fallback.
- Updates the collector regression fixture.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
bin/omarchy-agent-usage-codex |
Updates CLI arguments and rate-limit selection. |
test/shell.d/agent-usage-codex-scanner-test.sh |
Tests current arguments and Codex-specific limits. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| rateLimitsByLimitId: { | ||
| codex: { |
Preferring rateLimitsByLimitId.codex on presence alone drops real numbers. The app-server's own schema marks every field of RateLimitSnapshot optional, so a codex bucket of {"limitId": "codex", "planType": null, "primary": null, "secondary": null} is valid and truthy, and it beat a populated rateLimits. limit_window() then discarded both windows and the panel hid its limits section, with usageStatusText empty so no error card explained the gap.
Choosing on content rather than presence keeps the Codex-specific bucket wherever it actually carries a window and falls through to rateLimits otherwise, which codex-cli 0.149.0 still marks required and undeprecated.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Reviewed on a disposable Omarchy worker with codex-cli 0.149.0 installed, and independently by Codex at xhigh reasoning. The approval policy change is right. On 0.149.0 the CLI rejects The schema claim does not hold, though the change itself is harmless.
Both are the same One defect, now fixed on your branch. 9571085 chooses on content rather than presence: the Codex bucket is used wherever it actually carries a One thing for the maintainer rather than for you. The stub's Tests ran on the worker through the shell-test wrapper, never on the review machine: 22 passed, 0 failed. Codex at xhigh reported the same null-bucket defect and agreed that nothing in the repository establishes the wire format; its independence is not currently guaranteed, since it can read the reviewing session's own files. It contributed the Waiting on the maintainer, who is choosing between six pull requests for this one line. |
|
#7649 is merged (4cd8a08) and makes this same fix: the collector now launches app-server with Closing as superseded. The second half of this PR — preferring the Codex-specific |
Summary
Fix the Codex usage collector for current Codex CLI versions.
Codex CLI 0.149.0 no longer accepts
untrustedas an--ask-for-approvalvalue. The collector therefore exited before responding to the app-serverinitializerequest and reported:Codex limits unavailableinitializeUse the supported non-interactive
neverpolicy instead.Also prefer the Codex-specific entry in
rateLimitsByLimitId.codex, while retaining the existingrateLimitsfallback for older app-server responses.Verification
test/shell.d/agent-usage-codex-scanner-test.shgit diff --checkThe regression test now verifies:
-a never