Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thermo-nuclear reviewSpec: Findings
Checked, no change needed
Fixes for 1-4 are being pushed as "Address thermo review". |
|
Thermo review fixes landed at d3e857c ("Address thermo review"). Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude. Fixed:
Left: none. UI unchanged (optional UI line stays skipped per the design note). Commands: |
Price a Priority day aggregate at the base model's short-context rates times the Fast multiplier, and price a Priority row outside the Fast lane at its Standard base like upstream. Keep fork rows as source evidence, keep a vanished trace database pending once it supplied evidence, bypass the debounce when the database first appears, read trace JSON leniently and keep the serialized cursor byte-stable.
Lane B review: fixes at acc54c4I reviewed the full diff against Fixes
The new tests catch regressions. As a mutation check, I made three temporary changes: turned off the day rebuild in Documented differences from upstream
Validation (Windows, toolchain 1.98.0)
UI proof: not applicable. The change is backend cost pricing only, with no new surface, setting or locale key. |
Summary
Codex local cost now prices Priority (Fast) turns at the Fast rate even when the session model is a plain
gpt-5.xname. Codex records each websocket request in<CODEX_HOME>/logs_2.sqlite; aresponse.createrequest withservice_tier == "priority"marks the turn as Priority. The cost scanner reads that database read-only and reprices matching session rows when day totals are rebuilt. Backend only: corrected numbers show up wherever Codex cost already shows (tray cost card, Settings usageSpend,codexbar cost). No new setting, surface, or locale key.Approved design
Design note
design-codex-priority-trace.md(approved DEFER item, upstream v0.65.0 item #29), implemented as written, backend only. The optional usageSpend "Priority pricing detected" line was skipped as recommended.<CODEX_HOME>/logs_2.sqlite(logs(rowid, ts, feedback_log_body), indexidx_logs_ts) through the existingopen_readonly_sqlite_connectionhelper (WAL safe, 250 ms busy timeout, never writes).websocket request:JSON,Submission sub=Submission {rows,websocket event:response.completed), turn-id extraction, and completed-model retention limit (4096) as upstream.codex_priority_turns_cursor): last rowid, NTFS file identity, coverage window start, SHA-256 anchors over four sampled rows (a rewritten DB rebuilds), pruning of turns whose source rows Codex deleted, and rowid-chunked scanning that honors cancellation and keeps partial progress.turn_id(fromtask_started/turn_id); the Priority overlay is applied when day totals are rebuilt and in quota-window slices, and is never baked into persisted pricing evidence.tracing::debug!only, no bodies, no error). Turn evidence is scoped to sessions under the sameCODEX_HOMEas the database. Only ids, model names, and timestamps are stored; bodies are parsed in memory and never logged.rusqlite,sha2already present). Codex cache schema bumped 3 to 4, so older caches rebuild once.Upstream reference
Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+CodexPriority.swift(query, parsers, cursor),Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift(turn ids, priority pricing),Sources/CodexBarCore/CodexPriorityDatabasePath.swift.Ported / Deferred
Ported: everything above, including cursor, anchors, pruning, retention limit, and
-prioritypricing through existing Fast multipliers (models without a Fast lane stay Standard, as upstream).Deferred / differences:
anchorRowID/anchorDigestsingle anchor are replaced by the persisted cost-cache cursor with four sampled anchors and a two-of-four quorum; behavior for a rewritten DB is the same (rebuild).logs_2.sqlitehas no priority rows to compare against (schema andturn.id=prefix format were confirmed read-only), so real-data proof is fixture based.Validation
Toolchain
cargo +1.98.0, build slot-2, E-core wrappers.cargo fmt --all: clean.cargo clippy --workspace --all-targets -- -D warnings: pass (both manifests).cargo test -p codexbar priority_trace: 20 passed (parsers, cold/incremental scan, anchors, rewritten DB, pruning, cancel, missing/corrupt DB, retention bound, scope, end-to-end scan pricing).cargo test -p codexbar(full): 2180 passed, 0 failed, 1 ignored.Affected areas
rust/src/cost_scanner,core/jsonl_scanner,codex_costs)docs/PROVIDERS.mdCodex cost note)UI proof
Not applicable (backend only; no UI surface changed).