Repository navigation
Commit b464edc
committed
fix(opencode): count only completed v2 compaction rows
Compaction rows were accepted by type alone. Running and failed
compactions stayed out only because the existing parser drops rows
without a model, and that was incidental. OpenCode's failed compaction
still records usage: compaction.ts publishes Compaction.Failed with the
cost and tokens of every call already billed, and the CompactionFailed
schema keeps those fields while omitting the model. A failed row that
gained a model, from another OpenCode version or a provider that
records one, would have been counted, even though attributing failed
compactions is outside this change.
Pass the row kind to the parser and accept a compaction only when its
status is "completed". Group the row fields into a SessionMessageRow so
the parser signature stays within clippy's argument limit.1 parent 2585e04 commit b464edc
2 files changed
Lines changed: 89 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 446 | + | |
| 447 | + | |
452 | 448 | | |
453 | 449 | | |
454 | 450 | | |
| |||
472 | 468 | | |
473 | 469 | | |
474 | 470 | | |
475 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
476 | 481 | | |
477 | 482 | | |
478 | 483 | | |
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
482 | | - | |
| 487 | + | |
483 | 488 | | |
484 | 489 | | |
485 | 490 | | |
| |||
1669 | 1674 | | |
1670 | 1675 | | |
1671 | 1676 | | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
1672 | 1701 | | |
1673 | 1702 | | |
1674 | 1703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
116 | 135 | | |
117 | 136 | | |
118 | 137 | | |
| |||
312 | 331 | | |
313 | 332 | | |
314 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
315 | 342 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
| 343 | + | |
320 | 344 | | |
321 | 345 | | |
322 | 346 | | |
323 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
324 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
325 | 361 | | |
326 | 362 | | |
327 | 363 | | |
| |||
501 | 537 | | |
502 | 538 | | |
503 | 539 | | |
504 | | - | |
505 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
506 | 543 | | |
507 | 544 | | |
508 | 545 | | |
509 | 546 | | |
510 | 547 | | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
515 | 555 | | |
516 | 556 | | |
517 | 557 | | |
| |||
0 commit comments