You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A native Guardian safety check on a ChatGPT session produced a valid, exact token record for the requested model codex-auto-review. Codexometer looked it up in the standard API price table, emitted UNPRICED USAGE and discarded an otherwise usable quota-learning interval. The reported response had a matching checkpoint for the main Codex limit on a recognised ChatGPT plan.
Both Quota interfaces use the shared accounting fix. A confirmed plan safety check contributes neither API-equivalent spend nor an unpriced-call warning. Sessions still records its tokens, output and activity. Paid responses in the same learning interval keep their normal value.
Require native Guardian provenance, the OpenAI provider, the reviewer model and a complete main-Codex token checkpoint with a known plan. Pair an exact response by thread, turn, adjacent rollout ordinal and matching usage; allow a checkpoint split across two polls. A valid legacy token event can supply its own evidence. No current-login lookup, transcript inspection or new persistent data.
If evidence is missing, keep the unpriced diagnostic and explain why. A matched daemon reroute to a different model is priced normally. Benchmark pricing, the model price table and official quota percentages are unchanged.
Verification
Synthetic regression coverage for exact/legacy responses, a split append, model rerouting, ordinary sessions using the same slug, custom providers, missing/malformed plan data, mismatched turn/ordinal/usage, and subsequent paid usage and replay.
go test -race ./internal/codex ./internal/quotaestimate; go test ./...; go vet ./...; production duplication ratchet.
Scoped duplication cleanup
Three separate refactors share the DigBench interrupt handshake, slash-menu keyboard/wheel movement, and history button layout and hitboxes. DigBench cancellation and timeout outcomes remain distinct; command confirmation, inline filtering, and the full/compact history controls are unchanged. Regression tests cover unrelated thread and turn completions as well as input handling.
On the pinned production scan, exact-50 falls from 29 to 25 clone pairs (267 to 233 duplicated lines), and exact-100 from 2 to 1. The normalised scans also improve: 136 to 131 at 50 tokens, and 10 to 9 at 100. The tracked baseline is left to main CI.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Approval should wait for human validation because the quota exemption relies on pinned Codex rollout ordinals, the token_count rate-limit schema, and daemon/local polling behavior that cannot be verified here through the declared race and full tests.
No open issues 🎉
What changed in this PR
This PR updates quota-learning accounting so confirmed ChatGPT Guardian Auto-review usage remains in Sessions telemetry while being excluded from API-equivalent spend and unpriced-usage diagnostics.
Changes:
Validate Guardian provenance, OpenAI provider metadata, reviewer model, recognized plan, and matching token checkpoints before applying the exemption.
Handle exact and legacy token records, split checkpoints, reroutes, replay, mismatches, and subsequent paid usage while preserving normal pricing when evidence is incomplete.
Document the behavior and add comprehensive regression coverage.
File
Description
README.md
Documents confirmed Auto-review quota-learning exclusions and evidence requirements.
intro-post.md
Updates user-facing guidance for Auto-review telemetry and quota accounting.
internal/codex/service_tier.go
Implements Auto-review provenance detection, plan validation, and exempt quota accounting.
internal/codex/service_tier_test.go
Updates reconciliation test callers for the new readiness parameter.
internal/codex/live_usage.go
Tracks provider metadata, plan checkpoints, review evidence, and deferred reconciliation across polls.
internal/codex/live_usage_test.go
Updates existing live-usage reconciliation test callers.
internal/codex/live_usage_guardian_test.go
Adds regression coverage for Guardian Auto-review quota-accounting scenarios.
internal/codex/live_usage_exact.go
Associates exact responses with adjacent matching token checkpoints and review evidence.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The plan-type switch omits valid emitted variants, so eligible Guardian checkpoints can still produce unpriced usage until those variants and regression cases are added.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Recognize all supported plan types in the usage exemption
internal/codex/service_tier.go:39
This switch is not exhaustive for the plan_type values emitted in token_count.rate_limits: Codex rust-v0.169.0 also defines free_workspace, education, quorum, and k12 (with education distinct from edu). A valid Guardian checkpoint for one of those plans will therefore leave planReviewEvidence false and still produce UNPRICED USAGE, so the exemption remains incomplete. Include the supported plan variants and add regression cases for them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A native Guardian safety check on a ChatGPT session produced a valid, exact token record for the requested model
codex-auto-review. Codexometer looked it up in the standard API price table, emitted UNPRICED USAGE and discarded an otherwise usable quota-learning interval. The reported response had a matching checkpoint for the main Codex limit on a recognised ChatGPT plan.OpenAI’s ChatGPT plan guidance distinguishes plan-exempt Auto-review from ordinary usage. That is not a published $0 API rate. Codex’s pinned integration tests also show why the reviewer model name alone is not proof of ChatGPT billing.
What changes
Verification
go test -race ./internal/codex ./internal/quotaestimate;go test ./...;go vet ./...; production duplication ratchet.Scoped duplication cleanup
Three separate refactors share the DigBench interrupt handshake, slash-menu keyboard/wheel movement, and history button layout and hitboxes. DigBench cancellation and timeout outcomes remain distinct; command confirmation, inline filtering, and the full/compact history controls are unchanged. Regression tests cover unrelated thread and turn completions as well as input handling.
On the pinned production scan, exact-50 falls from 29 to 25 clone pairs (267 to 233 duplicated lines), and exact-100 from 2 to 1. The normalised scans also improve: 136 to 131 at 50 tokens, and 10 to 9 at 100. The tracked baseline is left to main CI.