Commit 09de881
authored
test(jsonl): add jsonl_parser schema coverage and harden null usage (#22)
* test(jsonl): add jsonl_parser schema coverage and harden null usage
Add tests/test_jsonl_parser.py covering _parse_tool_result dispatch,
content helpers, user/assistant/system paths, file activity, parse_session
integration, quick_session_info, and malformed entries. Treat non-dict
message.usage in _process_assistant as empty to avoid crashes on null usage.
* fix(jsonl): coerce null message before parsing JSONL entries
* 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 d8d77de commit 09de881
2 files changed
Lines changed: 875 additions & 3 deletions
0 commit comments