Skip to content

fix: re-price zero-cost records and improve error resilience#14

Merged
mm65x merged 2 commits intodevelopfrom
chore/desloppify-round2
Mar 22, 2026
Merged

fix: re-price zero-cost records and improve error resilience#14
mm65x merged 2 commits intodevelopfrom
chore/desloppify-round2

Conversation

@mm65x
Copy link
Copy Markdown
Owner

@mm65x mm65x commented Mar 22, 2026

Two targeted fixes from the latest desloppify pass:

  • Records with cost_usd of 0.0 (e.g. from OpenCode storing cost: 0 for models it can't price) are no longer permanently locked at $0. The pricing engine now treats zero-cost entries as unpriced and recalculates them against the latest pricing data.
  • Replaced map_while(Result::ok) with filter_map and error counters in claude_code.rs, pi_agent.rs, and jsonl_source.rs. A single I/O error no longer silently truncates the rest of the file. Added skip counter to mark_preserved in cache.rs for row-level errors.

mm65x added 2 commits March 22, 2026 13:36
Source parsers (e.g. OpenCode) store cost: 0 for models they can't price.
The apply_costs guard treated Some(0.0) as 'already priced', permanently
locking these records at $0. Now only positive costs are preserved.
- Changed map_while(Result::ok) to filter_map with error counters in
  claude_code.rs, pi_agent.rs, and jsonl_source.rs so a single bad line
  doesn't abort the entire file parse.
- Added skip counter to mark_preserved in cache.rs for row-level errors.
@mm65x mm65x merged commit 9fa1ee5 into develop Mar 22, 2026
5 checks passed
@mm65x mm65x deleted the chore/desloppify-round2 branch March 22, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant