Repository navigation
Conversation
c0dc557 to
2c9a34a
Compare
There was a problem hiding this comment.
Pull request overview
Brings Codex usage reporting closer to Claude’s Agents panel presentation.
Changes:
- Adds human-readable plan and limit labels.
- Exposes model-scoped limits and spend-control status.
- Uses Codex’s supported
on-requestapproval policy and expands tests.
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.
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 |
Normalizes and collects expanded Codex limit data. |
test/shell.d/agent-usage-codex-scanner-test.sh |
Adds realistic plan and scoped-limit assertions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ;; | ||
| account/rateLimits/read) | ||
| jq -cn --argjson id "$id" '{id: $id, result: {rateLimits: {}}}' | ||
| jq -cn --argjson id "$id" '{id: $id, result: {rateLimits: {limitId: "codex", planType: "prolite", primary: {usedPercent: 6, windowDurationMins: 10080, resetsAt: 1787887121}, secondary: null}, rateLimitsByLimitId: {codex: {limitId: "codex", planType: "prolite", primary: {usedPercent: 6, windowDurationMins: 10080, resetsAt: 1787887121}}, codex_bengalfox: {limitId: "codex_bengalfox", limitName: "GPT-5.3-Codex-Spark", primary: {usedPercent: 0, windowDurationMins: 300, resetsAt: 1787379264}, secondary: {usedPercent: 12, windowDurationMins: 10080, resetsAt: 1787966064}}}}}' |
5995a08 to
fb8a344
Compare
The Codex row reported a plan and limit windows that did not match what Codex itself shows: the label ignored the plan on the account, and limit windows were read without scoping them to the model they belong to, so a window for one model could be reported against another. Read the plan label from the account record, and scope each limit window to its model before reporting it. A future-dated cache is treated as a miss rather than trusted, --limits-only falls back to a full scan when no cache exists, and an interrupted scan is no longer cached as if it had completed. test/shell.d/agent-usage-codex-scanner-test.sh covers the cache miss, the fallback, malformed rows, an unwritable cache, and the interrupted scan. All pass on quattro. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TT7trpn4vaR9Yj4yLdPjd1
fb8a344 to
f7e5af0
Compare
|
Rebased onto current This PR had drifted so far from its base that GitHub was rendering it as ~118,000 lines across 100 files, which made the Codex collector change impossible to actually review. That was an artifact of the branch point, not the change. It is now the real diff and nothing else. Tests pass on today's No behaviour has changed from what was originally proposed — only the base it sits on. |
|
On the Copilot note about the mock not inspecting its arguments — that was right, and it is already handled in this branch. # Fail if the collector regresses to `-a untrusted` (Codex 0.149 / #7648).
if [[ $1 != "-s" || $2 != "read-only" || $3 != "-a" || $4 != "on-request" || ${5:-} != "app-server" ]]; then
echo "unexpected codex invocation: $*" >&2
exit 1
fiThe comment predates the rebase, so it may be pointing at the older diff. |
Changes
Brings the Codex tab of the Agents panel up to parity with the Claude tab.
account/rateLimits/readalready returns more than the collector showed, so this only surfaces what Codex reports:tierLabelbecomes a human plan name (prolite→ "Pro Lite",plus→ "Plus") instead of the raw API token, matching Claude's "Max 20x" / "Pro".rateLimitsByLimitId(e.g. "GPT-5.3-Codex-Spark", each with its own 5-hour and weekly window) are emitted with atitle, the way Claude reports "Fable Weekly", so the panel renders them as their own rows instead of dropping them.spendControlReachedsurfaces as the usage status text.-a on-request, same as Fix Codex usage collection on 0.149 #7649 (Codex 0.149 retireduntrusted, Codex 0.149 breaks Agents panel limit display #7648). Happy to rebase on Fix Codex usage collection on 0.149 #7649 once it lands — this is meant to stack on it, not compete with it.Before (Codex 0.149.0, Pro Lite): no plan,
limits: [].After:
Tests
bash test/shell.d/agent-usage-codex-scanner-test.sh— mock app-server now answers with a realisticrateLimits/rateLimitsByLimitIdpayload; asserts the plan label and every limit row../test/clibin/omarchy-agent-usage-codex --limits-onlyagainst Codex CLI 0.149.0 on Omarchy 4.0.0-1.🤖 Generated with Claude Code
https://claude.ai/code/session_01PDPn6hVmawjV1sSRLedsUD