Commit 2516812
committed
fix(agent): key the rtk savings counter to the task and drop the pct field
counter_id was the run_id, but a warm snapshot-resume restarts the
sandbox with its filesystem — and rtk tally — intact under a new
run_id, so a resumed run's reading re-counted the prior run's savings
under a fresh counter. The task tracks the database's lifetime; a cold
resume reads a dropped value, which the reset rule already handles.
Also make the zero-baseline rule explicit in the consumption contract
(a single reading counts in full) and stop emitting avg_savings_pct —
an average cannot be differenced; consumers derive the ratio from the
two cumulative token columns.
Generated-By: PostHog Code
Task-Id: b86391cc-4634-4a2b-ae34-fe1f9c0626a01 parent 5fe748e commit 2516812
4 files changed
Lines changed: 21 additions & 18 deletions
File tree
- packages/agent/src/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
| |||
534 | 533 | | |
535 | 534 | | |
536 | 535 | | |
537 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
538 | 539 | | |
| 540 | + | |
| 541 | + | |
539 | 542 | | |
540 | 543 | | |
541 | 544 | | |
| |||
559 | 562 | | |
560 | 563 | | |
561 | 564 | | |
562 | | - | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3387 | 3387 | | |
3388 | 3388 | | |
3389 | 3389 | | |
3390 | | - | |
3391 | | - | |
3392 | | - | |
3393 | | - | |
3394 | | - | |
3395 | | - | |
3396 | | - | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3397 | 3400 | | |
3398 | 3401 | | |
3399 | 3402 | | |
| |||
3426 | 3429 | | |
3427 | 3430 | | |
3428 | 3431 | | |
3429 | | - | |
3430 | | - | |
3431 | | - | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
3432 | 3438 | | |
3433 | 3439 | | |
3434 | 3440 | | |
3435 | 3441 | | |
3436 | | - | |
3437 | 3442 | | |
3438 | 3443 | | |
3439 | 3444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
0 commit comments