Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c89b576c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| u.model_name AS model_name, | ||
| COUNT(DISTINCT u.session_id) AS session_count, | ||
| COALESCE(SUM(COALESCE(u.cost_usd, sp.cost_usd, 0.0)), 0.0) AS stored_cost_usd, | ||
| COALESCE(SUM(u.cost_usd), 0.0) AS stored_cost_usd, |
There was a problem hiding this comment.
Preserve reported totals when model-usage rows exist
When a session has sessions.reported_cost_usd and any session_model_usage row, it is excluded from no_usage_rows, while this query sums only u.cost_usd. Providers such as Claude Code produce both a reported total and model rows, so their exact provider total is now discarded or replaced by a catalog estimate in cost rollups even though the session-cost insight still reports it as exact. Aggregate the canonical per-session verdict or otherwise include each reported total exactly once.
Useful? React with 👍 / 👎.
| u.model_name AS model_name, | ||
| COUNT(DISTINCT u.session_id) AS session_count, | ||
| COALESCE(SUM(COALESCE(u.cost_usd, sp.cost_usd, 0.0)), 0.0) AS stored_cost_usd, | ||
| COALESCE(SUM(u.cost_usd), 0.0) AS stored_cost_usd, |
There was a problem hiding this comment.
Distinguish unpriced model rows from missing tokens
For a session_model_usage row with positive token counts but no catalog price, SUM(u.cost_usd) is null and this COALESCE converts it to zero. The downstream rollup then classifies the row as unavailable but unconditionally records {"no_tokens": ...} at lines 2742-2744, so rollups contradict session-cost insights by claiming token evidence is absent rather than reporting price_not_materialized. Preserve the missing-price state through aggregation and emit the corresponding typed reason.
Useful? React with 👍 / 👎.
6c89b57 to
caf551a
Compare
|
Closing without merge: this branch was cut pre-#4225 and its core change (removing the profile-cost fallback) collided with #4225's v75 rework of the same surface. After rebase the branch mixes eras (unavailable-cost tests still assert 0.0 vs the branch's null semantics, coverage rollup drops duration, v75 schema mismatches in facade tests). The bead is being redispatched against current master; the null-with-typed-reason design from this attempt carries forward. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: caf551a480
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Fixes polylogue-jfeaz (P0): cost surfaces no longer coerce an absent price to $0.00, and the cycle outlook reads the whole archive instead of a 50-session window. ## Problem (evidence) An unpriceable session surfaced as `$0.00` — indistinguishable from free — and outlook rollups silently truncated. A prior attempt (PR #4239) collided with #4225's v75 rework and was rejected; this redispatch was built against current master with the collision guidance on the bead. ## Solution - `total_usd: float | None` with the typed `price_not_materialized` reason; JSON surfaces preserve `null`. - Canonical availability semantics kept intact: `priced`/`provider_money`/`known_zero` (origin-reported provider money, `reported_cost_usd`) remain authoritative, now with explicit test coverage. - Cycle outlook uses an explicit unbounded selection; unavailable-status insights preserve the archive's typed absence evidence. ## Verification - Lane-verified quick gate green post-rebase (machine trailer); focused pricing/profile suites extended (+61/−35 across 11 files). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Fixes polylogue-jfeaz (P0): cost surfaces reported $0.00 spent when the price was absent and silently windowed rollups to 50 sessions.
Problem (evidence)
An unpriceable session (missing price table entry, or tokens without materialized pricing) surfaced as
$0.00— indistinguishable from genuinely free — and the cycle outlook read only a 50-session window, understating spend.Solution
total_usd: nullwith the typed reasonprice_not_materialized(distinct fromno_tokens).Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA