Skip to content

Commit b375f91

Browse files
committed
Ignore forked-session replay in usage parsing
Add logic to detect and ignore replayed events from forked sessions so they don't inflate usage totals, while still counting new post-fork activity. Bump the scan-cache DB schema to v3 and add a migration that clears stale cache rows that must be reparsed under the new semantics. Introduce ForkReplayState and related helpers (maybe_start_fork_replay, fork_replay_should_skip_event, note_fork_replay_token) and update parsing/scan flows to skip replayed events but preserve token-count bookkeeping. Add timestamp parsing helper and tests covering fork-replay behavior, cache migration, and snapshot computation. Also bump package version to 0.3.4, update CHANGELOG/README, and add /temp to .gitignore.
1 parent 15fcb70 commit b375f91

6 files changed

Lines changed: 498 additions & 26 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/dist
55
/dist_*
66
/internal
7+
/temp

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project are documented in this file.
44

5+
## 0.3.4 - 2026-04-24
6+
7+
- Fixed inflated usage totals from forked/subagent session logs by ignoring replayed parent-session token history while preserving new post-fork usage.
8+
- Bumped the scan-cache schema to reparse stale forked-session cache rows.
9+
510
## 0.3.3 - 2026-03-18
611

712
- Added a built-in Session history screen to the main `comon` TUI:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "comon"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
edition = "2021"
55
license = "Apache-2.0"
66

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ See `CHANGELOG.md` for release history.
1616
<img width="2088" height="952" alt="WindowsTerminal_HjIAOZQKWE" src="https://github.com/user-attachments/assets/4e3eed0a-d3aa-4ae5-bc4e-c6e5400bc1dd" />
1717

1818

19-
## Release 0.3.3
19+
## Release 0.3.4
2020

21+
- Fixed inflated usage totals from forked/subagent session logs.
22+
- Reparse stale forked-session cache rows with scan-cache schema v3.
2123
- Merged the session-history browser into the main `comon` TUI.
2224
- Added runtime screen switching between Usage and Session history with `s` / `F2`.
2325
- Added `--read` to start on the Session history screen.

0 commit comments

Comments
 (0)