Skip to content

Show auth file usage and remaining Codex quota estimates#317

Closed
AndrewZhuCC wants to merge 2 commits into
seakee:mainfrom
AndrewZhuCC:codex-auth-file-usage-quota-estimates
Closed

Show auth file usage and remaining Codex quota estimates#317
AndrewZhuCC wants to merge 2 commits into
seakee:mainfrom
AndrewZhuCC:codex-auth-file-usage-quota-estimates

Conversation

@AndrewZhuCC

@AndrewZhuCC AndrewZhuCC commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Add per-auth-file usage totals and Codex quota estimates to Auth Files, plus fleet-wide remaining capacity estimates on Quota Management.
Quota estimates are aligned to each credential's active provider reset window so retained history is never mixed with a newly reset percentage.

Scope

  • Frontend panel
  • Manager Server
  • CPA panel mode
  • Full Docker mode
  • Native packages / release
  • Docs / Wiki
  • CI / build / tooling

Changes

  • Show retained-history token and cost totals for matching auth file name and auth index.
  • Estimate Codex 5-hour and weekly token/value limits from credential-scoped analytics for the active provider reset window.
  • Show fleet-wide estimated remaining Codex tokens and value above the credential cards, with estimate coverage.
  • Keep quota percentage, sample time, reset time, reset label, and window duration aligned when API and usage-header quota state are merged.
  • Prevent old-window analytics rows from being reused while a newly reset window is loading; incomplete credential queries can retry on refresh.

User Impact

Operators can see recorded usage per auth file and approximate current-window Codex capacity at both account and fleet level. Estimates display as unavailable when matching analytics, quota percentage, reset metadata, or window duration is missing.

Compatibility / Runtime Notes

  • CPA panel mode: Uses the existing Manager Server monitoring analytics endpoint when request monitoring is available; otherwise estimates fail closed.
  • Manager Server mode: No endpoint, database, or configuration changes are introduced by this PR.
  • Full Docker / native packages: No new runtime settings or migration steps; rebuilt bundles include the updated frontend.

Data / Security Notes

Uses existing local credential_stats only, filtered by auth file name and auth index. No auth contents, new telemetry, external billing calls, browser persistence, or database schema changes are added.

Risk / Rollback

Risk level: Medium

Rollback notes:

  • Revert this PR to restore the previous auth-file and quota displays.
  • Analytics failures are isolated to placeholders and do not block existing auth-file or quota controls.

Verification

  • Type check
  • Lint
  • Tests
  • Build
  • Manual UI check
  • Docs/link check
  • Not applicable, docs-only

Commands / evidence:

npm --workspace apps/web run type-check
npm --workspace apps/web run lint
npm test                       # 88 test files, 717 tests passed
npm run build
docker buildx build --platform linux/amd64 --load -f Dockerfile.manager-server ...

Screenshots / Recordings

image image

Docs

  • README updated
  • Wiki updated
  • Release notes needed
  • Not needed

Related

N/A

@AndrewZhuCC AndrewZhuCC changed the title Show auth file usage estimates Show auth file usage and remaining Codex quota estimates Jul 10, 2026
@josephcy95

Copy link
Copy Markdown

这个不错 可以看到不同账号的体质

@seakee

seakee commented Jul 10, 2026

Copy link
Copy Markdown
Owner

首先非常感谢你的 PR,但是这些功能已经在新版的凭证管理里面做了,而且更详细,预计下周会正式发布,前面在群里已经做了预告了。合并的话没有多大意义了,因为全新的凭证管理很快就发布了,所以这个 PR 不会合并了。

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.

3 participants