Repository navigation
Commit d466859
wangchen01
fix(session-analysis): recognize lowercase edit tool names from Pi sessions
Pi's coding agent emits lowercase tool names (edit, write), while the
edit-event detection in episode-contract and insights matched Claude
Code's capitalized names (Edit, Write) with a case-sensitive Set lookup.
Every Pi edit event was therefore missed, which surfaced as
withChanges: 0 in session facts for any workspace with real commits.
Store the edit tool names lowercase and compare against the lowercased
tool name, matching the existing case-insensitive check used for
PATHLESS_EDIT_TOOL_NAMES in the same function.
Validation: reran session-analysis facts --platform pi over a 254-session
workspace; populationCoverage.withChanges moved 0 -> 29, candidate
classes gained change-gap 11, and read-only-work dropped 44 -> 21 as
editing episodes were no longer misclassified. The existing episode
contract and lifecycle signal tests (28 tests, all using capitalized
Claude tool names) pass unchanged, confirming backward compatibility.1 parent 1eea73a commit d466859
2 files changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
724 | 725 | | |
725 | 726 | | |
726 | 727 | | |
727 | | - | |
| 728 | + | |
728 | 729 | | |
729 | 730 | | |
730 | 731 | | |
| |||
0 commit comments