Repository navigation
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesApply Fast pricing to Terra and Luna requests, add bundled Terra rates, and preserve released usage stores during repricing. Example: A Terra Fast request has 272,001 input tokens, including 200,000 cached tokens, and 10,000 output tokens.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current pricing error and resolves the earlier released-store compatibility finding; no actionable defect remains in the reviewed diff. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCodexBar parses native Codex session logs into persisted token rows, resolves model and service-tier pricing, and publishes API-equivalent estimates through the CLI and app. flowchart LR
A[Codex session logs] --> B[Usage scanner]
B --> C[SQLite token rows]
C --> D[Shared pricing resolver]
E[Catalog and bundled rates] --> D
D --> F[CLI and app cost reports]
Technical reviewBest possible solution: Land the focused extension of shared pricing with released-store adoption and stale-total recalculation. Do we have a high-confidence way to reproduce the issue? Current main omits both models from the Fast multiplier, causing the shared scanner to retain Standard costs; the contributor also supplies matching base and v0.84.0 CLI results. Is this the best way to solve the issue? The patch uses the existing pricing and compatibility owners, preserves catalog precedence, and adds focused coverage for catalog fallback, token thresholds, and released-store adoption. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7447bc77c249. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 12, 2026, 7:37 AM ET / 12:37 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Native Codex requests marked Fast (
service_tier: priority) for GPT-6.1 Terra and GPT-6 Luna currently fall back to Standard API-equivalent pricing. Apply the published 2× Fast rates to both models, including prompts above 272,000 input tokens. Bundle Terra’s Standard rates for offline or incomplete pricing catalogues and regenerate the parser hash so saved estimates can be recalculated.The store compatibility update recognises the parser hash shipped in v0.84.0. Existing request rows and scan checkpoints survive the upgrade. Cached reports that used stale pricing are invalidated and recalculated.
The Terra and Luna model cards document the Fast and long-context rates. This follows the Sol pricing path from #4814.
Validation: focused Swift tests passed for both models at 272,000 and 272,001 input tokens, with and without catalogue data. Cases include cached reads, cache writes and output tokens. The parser-hash check, SwiftFormat and repository-wide strict SwiftLint passed.
Fast pricing verification
On 12 November 2026, the macOS
CodexBarCLIreproduced the pricing bug on the PR base and passed all four Fast cases with the patch. Both the populated catalogue and bundled fallback returned the published prices in the patched build. The CLI bundled in the signed v0.84.0 app matched the PR base in both modes. The same eight synthetic requests were used throughout, with no account credentials or personal session history. CodexBar PR #5067With the populated catalogue, the four Standard controls matched between builds. The API-equivalent subtotal moved from US$0.8222044 to US$1.2333066. With the empty catalogue, base Terra costs were absent and base Luna Fast requests used Standard prices. The known subtotal moved from US$0.0802004 to US$1.2333066, with four unpriced items falling to zero. In both modes each report contained 2,256,004 tokens, four Standard and four Fast requests, established history coverage and zero unmetered items.
The TSV below was extracted from the two sets of real CLI daily model breakdowns.
nullrepresents a cost absent from the base CLI output.Fixture and commands
Each model had one request per UTC day in a synthetic Codex session. The four days from 2 to 5 November used Standard at 272,000 input, Fast at 272,000 input, Standard at 272,001 input, and Fast at 272,001 input, respectively. Each request had 200,000 cached input tokens and 10,000 output tokens, including 2,000 reasoning tokens. The generated sessions supplied
session_meta,thread_settings_applied,task_started,turn_context, and an identifiedtoken_usage_record. The tier values weredefaultandpriority.For example, the short Fast case for Terra used the records below in
.codex/sessions/2026/11/03/rollout-2026-11-03T12-00-00-gpt-6.1-terra.jsonl. The other fixtures change the model, date, identifiers, input count or tier according to the table. The syntheticconfig.jsoncontained{"version":1,"providers":[{"id":"codex","enabled":true}]}.{"type":"session_meta","timestamp":"2026-11-03T12:00:00Z","payload":{"id":"synthetic-2026-11-03-gpt-6.1-terra","timestamp":"2026-11-03T12:00:00Z"}} {"type":"event_msg","timestamp":"2026-11-03T12:00:00Z","payload":{"type":"thread_settings_applied","thread_settings":{"service_tier":"priority"}}} {"type":"event_msg","timestamp":"2026-11-03T12:00:00Z","payload":{"type":"task_started","turn_id":"synthetic-turn"}} {"type":"turn_context","timestamp":"2026-11-03T12:00:00Z","payload":{"model":"gpt-6.1-terra","turn_id":"synthetic-turn"}} {"type":"token_usage_record","timestamp":"2026-11-03T12:00:00Z","payload":{"thread_id":"synthetic-2026-11-03-gpt-6.1-terra","response_id":"synthetic-response","turn_id":"synthetic-turn","model":"gpt-6.1-terra","usage":{"input_tokens":272000,"cached_input_tokens":200000,"output_tokens":10000,"reasoning_output_tokens":2000,"total_tokens":282000},"thread_token_usage":{"input_tokens":272000,"cached_input_tokens":200000,"output_tokens":10000,"reasoning_output_tokens":2000,"total_tokens":282000},"turn_token_usage":{"input_tokens":272000,"cached_input_tokens":200000,"output_tokens":10000,"reasoning_output_tokens":2000,"total_tokens":282000}}}The same synthetic catalogue supplied both models’ Standard rates to both binaries. In USD per million tokens, the short-context input, cached input and output rates are $1.00, $0.05 and $5.00 for Terra, and $0.10, $0.01 and $0.50 for Luna. Above 272,000 input tokens, input and cache rates double and output becomes 1.5× for the entire request. Fast doubles the applicable rates. For example, the Terra Fast request at 272,001 input costs
2 × (72,001 × 2 + 200,000 × 0.10 + 10,000 × 7.50) / 1,000,000 = $0.478004. GPT-6.1 Terra model pricing, GPT-6 Luna model pricingThe PR base was
7447bc77c2497323d9c41e40164ce705533493c8. The patched build used commit056563def749ece9980a7381d537702db17d7eaawith the local cache compatibility follow-up. Both checkouts built withswift build --product CodexBarCLIon Apple Swift 6.4.2 for arm64 macOS. All binaries ran separately against fresh fixture homes with byte-identical session files. The catalogue mode used a fresh models.dev cache artifact populated with the two model rates and their 272,000-token tiers. The bundled mode used a fresh artifact withcatalog.providersset to{}. It stayed empty after every CLI run, confirming the data came from the bundled pricing path.The table values came from the CLI’s daily model breakdown JSON. An independent decimal calculation compared every cost and token total against the fixture inputs and the published rates. The test exercised native log parsing, service-tier attribution, cost calculation and CLI reporting. It did not launch the desktop UI.
Existing store compatibility
A second synthetic test seeded a cache using the signed v0.84.0 CLI and opened it using a Swift harness linked against the patched
CodexBarCore. The cache migrated from schema77274700to82965678with zero rebuilds. All nine file records, nine request rows and one token snapshot survived. The stale report was cleared, and the interrupted scan recovered its exact pending line after the source was made available again. This checks that adopting the new pricing parser does not discard history or checkpoints from the released app.A separate warm-cache CLI run used the same command without
--refresh. After the signed v0.84.0 CLI seeded the store, one Luna Fast source was compressed to.jsonl.zstand the plain source was removed from the scanner's scope. The patched CLI opened the existing database. Its inode and all eight usage-row payloads stayed byte-identical, including the archive-only row. The report repriced US$0.8222044 to US$1.2333066 with the same 2,256,004 tokens.