Skip to content

Show all Codex usage pools - #7543

Closed
theMTset wants to merge 6 commits into
omacom:quattrofrom
theMTset:feat/codex-named-usage-pools
Closed

theMTset wants to merge 6 commits into
omacom:quattrofrom
theMTset:feat/codex-named-usage-pools

Conversation

@theMTset

@theMTset theMTset commented Aug 19, 2026 •

Copy link
Copy Markdown

Why

Codex can return multiple usage pools in rateLimitsByLimitId, such as the main Codex allowance and a separate GPT-5.3-Codex-Spark allowance. The collector currently reads only the top-level rateLimits object, leaving additional pools invisible in the agents panel.

What changed

  • read all entries from rateLimitsByLimitId when available
  • label named pools using the name supplied by Codex
  • keep the default Codex pool first
  • avoid duplicating the default pool
  • fall back to the existing top-level response for older Codex versions
  • use the current non-interactive Codex approval policy when starting app-server
  • hide untouched Codex five-hour meters until usage begins, while leaving other providers unchanged

Validation

  • verified live against Codex CLI 0.149.0 with main Codex and GPT-5.3-Codex-Spark pools
  • verified that an untouched Codex five-hour meter disappears after restarting the shell
  • focused agents panel, Claude limits, and Codex scanner tests passed
  • collector test verifies the supported -a never app-server invocation
  • full shell suite passed except three packaging checks requiring a separate omarchy-pkgs checkout
  • legacy top-level Codex response fallback is covered
  • git diff --check

Fixes #7873.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 20:37

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.

Pull request overview

Extends Codex usage collection to support multiple rate-limit pools while retaining legacy fallback behavior.

Changes:

  • Collects and orders all Codex usage pools.
  • Labels named pools and adds regression coverage.

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 Collects grouped Codex rate limits with fallback support.
test/shell.d/agent-usage-codex-scanner-test.sh Tests multiple usage pools and deduplication.

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

Comment on lines +34 to +45
rateLimitsByLimitId: {
codex: {
limitId: "codex",
limitName: null,
primary: {usedPercent: 94, windowDurationMins: 10080, resetsAt: 1787196799}
},
codex_bengalfox: {
limitId: "codex_bengalfox",
limitName: "GPT-5.3-Codex-Spark",
primary: {usedPercent: 12, windowDurationMins: 10080, resetsAt: 1787357885}
}
}
Copilot AI review requested due to automatic review settings August 19, 2026 20:44

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.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 19, 2026 20:48

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.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

test/shell.d/agent-usage-codex-scanner-test.sh:34

  • This fixture already places the default codex entry first, so the test passes even if the new reordering logic is removed. Put codex_bengalfox before codex in the mocked response while retaining the current expected output to cover the stated default-first behavior.
        rateLimitsByLimitId: {

Copilot AI review requested due to automatic review settings August 20, 2026 00:57

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.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

test/shell.d/agent-usage-codex-scanner-test.sh:74

  • The updated fixture now exercises only rateLimitsByLimitId, but the PR explicitly promises compatibility with older Codex responses that expose only top-level rateLimits. Add a second collector invocation without rateLimitsByLimitId and assert that its primary/secondary windows are retained, so this fallback cannot regress unnoticed.
[[ $(jq -c '{id, tierLabel, limits}' <<<"$result") == '{"id":"codex","tierLabel":"pro","limits":[{"label":"Weekly (7-day)","percent":0.94,"resetsAt":"2026-08-20T03:33:19+00:00","title":"Weekly limit"},{"label":"GPT-5.3-Codex-Spark · Weekly (7-day)","percent":0.12,"resetsAt":"2026-08-22T00:18:05+00:00","title":"GPT-5.3-Codex-Spark Weekly limit"}]}' ]] ||
  fail "Codex collector includes every named usage pool without duplicating the default pool" "$result"
pass "Codex collector includes every named usage pool without duplicating the default pool"

shell/plugins/agents/Panel.qml:122

  • This filter is provider-agnostic, so it also removes an untouched Claude session window (as the added Claude test confirms). That is a user-visible behavior change outside the PR's stated Codex-pool scope. Please either restrict the suppression to Codex or explicitly include and justify the cross-provider change in the PR scope.
      var isUnusedFiveHour = windowSpanMs(entry.label) === 5 * 3600 * 1000 && percent === 0
      if (percent >= 0 && !isUnusedFiveHour)

Copilot AI review requested due to automatic review settings August 20, 2026 02:09

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.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

@dhh

dhh commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks! Model-scoped Codex limit pools are being considered through #7725, which fits the panel's existing scoped-limit display. Closing in favor of that.

@dhh dhh closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents plugin cannot read Codex limits with Codex CLI 0.149.0 because -a untrusted is invalid

4 participants