Commit 9563dc7
committed
test(jsonl): add parser coverage; harden message/usage handling
Add tests/test_jsonl_parser.py for tool-result dispatch, helpers, parse_session,
quick_session_info, and malformed entries (null/non-dict message and usage).
Introduce _entry_message() so only dict messages are read; keep usage as a dict
before token accounting. Apply the same normalization in quick_session_info.
Use full-string == assertions in TestStripSystemTags; drop unused pytest import;
add regression for string-shaped assistant message.1 parent 3f6db99 commit 9563dc7
2 files changed
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
338 | 336 | | |
339 | 337 | | |
340 | 338 | | |
341 | | - | |
342 | | - | |
| 339 | + | |
343 | 340 | | |
344 | 341 | | |
345 | 342 | | |
| |||
351 | 348 | | |
352 | 349 | | |
353 | 350 | | |
354 | | - | |
355 | | - | |
356 | | - | |
| 351 | + | |
357 | 352 | | |
358 | 353 | | |
359 | 354 | | |
| |||
745 | 740 | | |
746 | 741 | | |
747 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
748 | 759 | | |
749 | 760 | | |
750 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | | - | |
| 178 | + | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
| |||
503 | 508 | | |
504 | 509 | | |
505 | 510 | | |
506 | | - | |
| 511 | + | |
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
| |||
0 commit comments