feat(usage-api): add toggle to query additional usage, and add pooled usage to /v1/usage#832
feat(usage-api): add toggle to query additional usage, and add pooled usage to /v1/usage#832huzky-v wants to merge 11 commits into
/v1/usage#832Conversation
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63d756ca23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 561c21dd68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aaea5e32ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e04b83e523
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Hermes owner-review blocker (current Evidence after And the official migration entrypoint fails on a fresh DB: Please rebase/update onto current |
43548c8 to
bbabad3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
bbabad3 to
feedbc6
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Harden `/v1/responses` routing under concurrent streaming load while preserving OpenAI-compatible continuity semantics - Add per-account response-create and stream leases/caps with stale lease reclamation and in-flight pressure-aware account selection - Keep `previous_response_id` and stored-object continuity owner-bound/fail-closed, even when soft prompt-cache affinity is present - Keep `prompt_cache_key` as soft cache-locality affinity that can reroute under local pressure - Normalize local overload diagnostics and add metrics for lease acquire/release/stale-reclaim/cap rejection paths - Harden streaming/SSE bridge behavior, including first-event failover and SDK-compatible heartbeat placement - Add regression coverage for previous-response owner miss/unavailable paths, prompt-cache softness, bridge reroute, lease cleanup, local overload taxonomy, and streaming timeout behavior - Update OpenSpec change `stabilize-responses-concurrency-streaming` Verified before merge: - GitHub PR state: `CLEAN / MERGEABLE` - GitHub checks: `23 total, 0 pending, 0 fail` - Codex review: current-head clean - Review threads: `0` unresolved - Local unit gate: `make test-unit` passed with `2220 passed, 3 skipped` - Local bridge integration gate: `make test-integration-bridge` passed with `126 passed` - `ruff check app/modules/proxy/service.py app/modules/proxy/affinity.py tests/unit/test_proxy_utils.py` - `ty check app/modules/proxy/service.py app/modules/proxy/affinity.py tests/unit/test_proxy_utils.py` - `openspec validate stabilize-responses-concurrency-streaming --strict` - `openspec validate --specs --strict` passed with `21 passed, 0 failed`
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
codex-lb/app/modules/api_keys/service.py
Line 475 in f0c54e1
When a key remains scoped but its assigned rows are gone (for example, after the assigned account is deleted), assigned_ids_by_key[row.id] is empty even though account_assignment_scope_enabled is still true. This makes the dashboard list path load all accounts here, and _compute_pooled_credits() treats an empty assigned_account_ids list as an unscoped all-account pool, so /api/api-keys/ can show pooled credit values from unrelated accounts for a key that should have no usable pool. Use the scope flag when deciding whether an empty assignment list means “all accounts” or “no scoped accounts.”
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Hermes owner-review blocker: the current-main code/test path is mostly healthy, but I still see one scoped-pool correctness bug plus OpenSpec/merge-gate issues before this should merge. Evidence: Requested fix:
For context, the previous migration-graph blocker appears resolved on my local current-main probe: merging |
Summary
Add
account_pool_usage(primary/secondary remaining percent) to/v1/usage, and add ausage_sectionsfield to API keys so admins can toggle which sections are exposed to clients.This rebuilt branch also folds #748, so API-key usage section persistence and new-limit request-log backfill move as one API-key usage feature.
Folded PRs
/v1/usage#832mainf0c54e194a6f3355f2591aa47771f27e2201d3adOpenSpec
openspec/changes/add-account-pool-usage-to-v1-usage/openspec/changes/backfill-api-key-limit-current-usage/Changes
usage_sectionsto API keys so clients can exposeupstream_limits,account_pool_usage, or both.account_pool_usageto/v1/usageby reusing pooled-credit computation.resetUsagebehavior and per-request truncated microdollar accounting.Test plan
Screenshots
The example
/v1/usageAPI output when both sections are enabled.The API configuration page added this.