Fix Codex synthetic usage in status without local OpenAI profiles#92520
Conversation
|
Codex review: needs changes before merge. Reviewed June 25, 2026, 8:27 PM ET / 00:27 UTC. Summary PR surface: Source +111, Tests +236. Total +347 across 5 files. Reproducibility: yes. The linked issue and PR body give a concrete live 2026.6.6 Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Land after Do we have a high-confidence way to reproduce the issue? Yes. The linked issue and PR body give a concrete live 2026.6.6 Is this the best way to solve the issue? No. The synthetic Codex route is the right layer, but the current merge preference is not the best fix until empty synthetic snapshots stop replacing useful existing OpenAI usage data. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dd0e4f6e61b8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +111, Tests +236. Total +347 across 5 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Added real production VPS before/after proof to the PR body. The before command is installed OpenClaw 2026.6.6 on |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
220380b to
08e19d7
Compare
|
@clawsweeper re-review Addressed the effective-auth routing finding in current head Validation run after the fix:
Real VPS before/after proof remains in the PR body and was already marked sufficient; current-head delta only narrows eligibility for API-key-backed routes. One current CI shard is failing with an unrelated temp cleanup |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
830dda2 to
da9f57f
Compare
afa4474 to
89e98a2
Compare
89e98a2 to
2b2e93a
Compare
|
Landed via rebase onto main.
Thanks @brokemac79! |
Summary
/statusCodex synthetic usage through the Codex app-server marker even when no local OpenAI OAuth/token profile label existsstatus --usageto add the Codex synthetic OpenAI usage snapshot only for configured OpenAI Codex runtime routes whose effective auth label is not API-key-backedCloses #92506
Linked context
08e19d72ac../codex:account/rateLimits/readmaps toGetAccountRateLimitsand returns Codex rate-limit snapshots used by the existing Codex provider usage hookReal behavior proof
status --usageshould show real Codex/OpenAI usage windows when the default OpenAI model is effectively running on the Codex runtime, even if the status process does not have a local OpenAI OAuth/token profile label. Current 2026.6.6 omitted the Codex/OpenAI usage line.polymarket-mc, Ubuntu arm64, prod OpenClaw home/config/gateway, gateway still running from installed OpenClaw 2026.6.6. After-fix command was run from an isolated PR checkout at~/oc-proof-92520, commit220380b3, without replacing or restarting the prod gateway service.08e19d72aconly adds the shared CLI effective-auth guard so API-key-backed OpenAI Codex runtime routes do not receive the synthetic app-server quota query; it does not change the proven no-profile app-server path.5handWeekwindows. The gateway stayed on the installed prod 2026.6.6 service; only the CLI process came from the isolated PR checkout./statusscreenshots because the real CLIstatus --usageoutput exercises the requested status usage path and ClawSweeper accepted copied live output as sufficient. The after command did not replace or restart the production gateway.Supplemental tests and validation
node scripts/run-vitest.mjs src/commands/status-runtime-shared.test.ts -- --reporter=verbose --pool=forks --maxWorkers=1 --fileParallelism=falsenode scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts src/commands/status-runtime-shared.test.ts src/commands/status-json.test.ts src/infra/provider-usage.auth.plugin.test.ts src/infra/provider-usage.load.plugin.test.ts -- --reporter=verbose --pool=forks --maxWorkers=1 --fileParallelism=falsenode scripts/run-vitest.mjs extensions/codex/provider.test.ts extensions/codex/src/app-server/rate-limits.test.ts -- --reporter=verbose --pool=forks --maxWorkers=1 --fileParallelism=falsenode scripts/run-tsgo.mjs -p tsconfig.core.json --noEmit --incremental falsenode scripts/run-tsgo.mjs -p tsconfig.extensions.json --noEmit --incremental falsegit diff --checkcodex -c service_tier='''fast''' review --base origin/main-> no actionable regressions found before the current-head API-key guard follow-upRisk checklist
checks-node-agentic-control-plane-agent-chat:ENOTEMPTYwhile removing/tmp/openclaw-gw-*; GitHub permissions did not allow me to rerun it