Repository navigation
feat: split provider and catalog model costs - #4493
Conversation
Codex Review SummaryThis 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. |
|
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: 99f607da5e
ℹ️ 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 Keep provider-reported and catalog-computed model costs in separate columns and restore summed precedence on archive cost rollups. ## Problem The split-cost migration had changed two cohort queries to select one provider row instead of summing the cohort, reporting 5.0 for three 5.0 sessions instead of 15.0. ## Solution Use `SUM(provider_cost_usd)` before `SUM(catalog_cost_usd)` on both cost-rollup surfaces and related archive readers. Keep catalog pricing and provider pass-through writes nominally separate, remove stale retired-column consumers, and add a three-session regression asserting 15.0 on both rollups. Rebased onto `origin/master` with the cost change at schema version 80 and its semantic-reparse declaration. ## Verification - `.venv/bin/python -m devtools test tests/unit/demo/test_demo_seed_verify.py tests/unit/storage/test_archive_tiers_write.py::test_read_archive_session_page_composes_bounded_sql_work_regardless_of_session_size tests/unit/storage/test_archive_tiers_write.py::test_read_archive_session_page_matches_full_composition_windows tests/unit/storage/test_archive_tiers_archive.py::test_archive_tiers_archive_facade_repairs_missing_fts_on_identical_repeat tests/unit/storage/test_archive_tiers_archive.py::test_pinned_read_only_store_blocks_all_archive_tier_mutations tests/unit/storage/test_session_insight_refresh.py::test_full_rebuild_restores_thread_spine_membership_and_markers`: 21 passed. - `.venv/bin/python -m devtools test tests/unit/storage/test_cost_queries.py tests/unit/storage/test_pricing_chain_roundtrip.py`: 18 passed. - `.venv/bin/python -m devtools verify --quick`: all checks passed, including mypy, schema versioning, layering, and privacy registry. ## Residual risk Full corpus verification was not run. Existing index generations need the declared semantic reparse before old cost rows are replaced; public compatibility payloads retain their `cost_usd` and `cost_provenance` field names.
The upward walk that resolves a session's repository stopped at nothing, so with the managed temp trees inside the checkout every scratch path resolved to the checkout itself. The walk now stops before a listed ceiling, as git does, and the ceiling is part of the normalization cache key. Tests: tool results without structural evidence are admitted as unknown with not_reported (#4539) and the writer refusal is exercised on a block with no evidence at all; block payloads carry tool_outcome (#4502); a provider-reported cost rolls up as "exact" (#4493); the v61 replace-table keeps the surviving canonical columns; the bulk-delete canaries and the naive-join survivor use TEMP objects on the opened connection so the schema manifest check at open no longer refuses them (#4472, #4594). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
|
Closing out open Codex review threads on this PR (evidence checked against master at 0914f89):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
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
Keep provider-reported and catalog-computed model costs in separate columns and restore summed precedence on archive cost rollups.
Problem
The split-cost migration had changed two cohort queries to select one provider row instead of summing the cohort, reporting 5.0 for three 5.0 sessions instead of 15.0.
Solution
Use
SUM(provider_cost_usd)beforeSUM(catalog_cost_usd)on both cost-rollup surfaces and related archive readers. Keep catalog pricing and provider pass-through writes nominally separate, remove stale retired-column consumers, and add a three-session regression asserting 15.0 on both rollups. Rebased ontoorigin/masterwith the cost change at schema version 80 and its semantic-reparse declaration.Verification
.venv/bin/python -m devtools test tests/unit/demo/test_demo_seed_verify.py tests/unit/storage/test_archive_tiers_write.py::test_read_archive_session_page_composes_bounded_sql_work_regardless_of_session_size tests/unit/storage/test_archive_tiers_write.py::test_read_archive_session_page_matches_full_composition_windows tests/unit/storage/test_archive_tiers_archive.py::test_archive_tiers_archive_facade_repairs_missing_fts_on_identical_repeat tests/unit/storage/test_archive_tiers_archive.py::test_pinned_read_only_store_blocks_all_archive_tier_mutations tests/unit/storage/test_session_insight_refresh.py::test_full_rebuild_restores_thread_spine_membership_and_markers: 21 passed..venv/bin/python -m devtools test tests/unit/storage/test_cost_queries.py tests/unit/storage/test_pricing_chain_roundtrip.py: 18 passed..venv/bin/python -m devtools verify --quick: all checks passed, including mypy, schema versioning, layering, and privacy registry.Residual risk
Full corpus verification was not run. Existing index generations need the declared semantic reparse before old cost rows are replaced; public compatibility payloads retain their
cost_usdandcost_provenancefield names.