Commit 39234cb
committed
Preserve subagent token totals during condensation
Condensation was recalculating Claude Code token usage without the session subagent transcript directory, so metadata written on user commits dropped Task-spawned token totals even though live session state could see them. The fix reuses the transcript-dir/session-id convention already used by lifecycle hooks and locks the behavior with a focused condensation regression.
Constraint: Checkpoint metadata pushes for this branch must route through stale2000/cli, so the committed Entire settings point checkpoint_remote at the fork.
Rejected: Rework token parsing or checkpoint storage | the loss was caused by a missing subagent transcript directory argument, not the parser or metadata schema.
Confidence: high
Scope-risk: narrow
Directive: Keep condensation subagent path derivation aligned with lifecycle hook path derivation when changing transcript layouts.
Tested: go test ./cmd/entire/cli/strategy -run 'TestCondenseSession' -count=1
Tested: go test ./cmd/entire/cli/agent/claudecode -run 'TestCalculateTotalTokenUsage|TestExtractAllModifiedFiles' -count=1
Not-tested: Full mise run check because unrelated local uiform work currently trips lint before this branch is isolated.
Entire-Checkpoint: 36286545221f1 parent 9403248 commit 39234cb
3 files changed
Lines changed: 73 additions & 3 deletions
File tree
- .entire
- cmd/entire/cli/strategy
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
465 | 472 | | |
466 | 473 | | |
467 | 474 | | |
| |||
898 | 905 | | |
899 | 906 | | |
900 | 907 | | |
901 | | - | |
| 908 | + | |
| 909 | + | |
902 | 910 | | |
903 | 911 | | |
904 | 912 | | |
| |||
940 | 948 | | |
941 | 949 | | |
942 | 950 | | |
943 | | - | |
| 951 | + | |
| 952 | + | |
944 | 953 | | |
945 | 954 | | |
946 | 955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
3323 | 3325 | | |
3324 | 3326 | | |
3325 | 3327 | | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
3326 | 3387 | | |
3327 | 3388 | | |
3328 | 3389 | | |
| |||
0 commit comments