Repository navigation
feat(codex): expose usage for a saved login - #132453
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
38c5fb7 to
99dba92
Compare
ece3de1 to
50f3432
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 9:57 PM ET / September 11, 2026, 01:57 UTC (Revision 83). ClawSweeper reviewWhat this changesAdds an administrator-only Codex plugin request that returns quotas, plan details, and credit balances for a selected saved subscription login. Merge readiness✅ Ready for maintainer review Keep open: the saved-account request remains distinct from current main and supports the paired UI work. No actionable defect was found in the introduced changes. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin connects OpenClaw to the Codex app-server. This request takes an agent and saved login, reads usage through an isolated child, and returns account-specific information to Gateway clients. flowchart TD
A[Gateway client] --> B[Administrator authorization]
B --> C[Validate saved login]
C --> D[Isolated Codex child]
D --> E[Read account quotas]
E --> F[Recheck current authority]
F --> G[Account usage response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +152, Tests +268, Docs +9, Other -1. Total +428 across 11 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep account-specific quota retrieval in the Codex plugin, using the existing reader and authorization owners, with the paired UI consuming its advertised method. Do we have a high-confidence way to reproduce the issue? Not applicable: this adds a saved-account request rather than repairing an established failing behavior; current-main inspection confirms the request is still absent. Is this the best way to solve the issue? Yes: the patch extends the existing Codex owner and reader, keeps runtime loading lazy, and preserves existing provider-summary behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d331583bbf0f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (82 earlier review cycles; latest 8 shown)
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
50f3432 to
82123e6
Compare
93cb374 to
31508fa
Compare
31508fa to
ca8ef65
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Codex quotas already existed through the app-server reader, but Models could not request usage for a particular saved login. This adds
codex.accountUsageinside the Codex plugin and reuses that reader with the selected profile. The handler loads on demand, keeping plugin discovery free of runtime dependencies.The method returns the plan, quota windows, additional quota groups, and credit balance. It requires
operator.admin, rejects API keys and other providers, and discards results when the selected credentials or caller authority change. Each request uses a temporary local app-server with ephemeral auth. Proxy launches are rejected before startup so a quota check cannot switch a shared daemon’s login. Existing provider summaries, organization billing, and auth-status behavior stay intact.Proof
An authenticated Gateway integration exercised the real registration, reader, auth bridge, store, and child transport. Two saved logins returned different quotas and balances; read/write clients and unsupported profiles started no child. Both children exited, inherited API credentials were absent, and the native Codex home remained unchanged. A second Gateway/Unix-socket proof reproduced account switching through a proxy before the fix and verified zero spawns or daemon requests afterward. Only the external Codex executable was synthetic; this is not live OpenAI API evidence.
All 96 focused tests passed across the plugin entry, account method, registration boundary, app-server request lifecycle, and rate-limit parser after syncing main. Typechecks, lint, architecture guards, and unused-export checks passed for the lazy-loading repair. Guard-test mutation proof confirms that omitting authority forwarding fails the tests. Required CI passed on the current commit.
How to verify
With the Codex plugin enabled and saved OpenAI subscription logins, request
codex.accountUsagewith{ agentId, profileId }as an administrator. The returned windows must belong to that profile. API-key and other-provider selections return an invalid-request error. The dependent UI is #132454.Change breakdown