Skip to content

test: add session-parser test suite (19 tests) - #73

Closed
TerminalGravity wants to merge 1 commit into
mainfrom
test/session-parser-tests
Closed

test: add session-parser test suite (19 tests)#73
TerminalGravity wants to merge 1 commit into
mainfrom
test/session-parser-tests

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Adds comprehensive tests for src/lib/session-parser.ts — the core JSONL parsing module used by timeline, scan-sessions, estimate-cost, and search-history tools.

19 tests covering:

  • User prompt → prompt event extraction
  • Assistant text response parsing
  • Tool call event extraction (regular + sub-agent spawn detection for Task/dispatch_agent)
  • Correction detection (user follows assistant with "no"/"wrong"/"undo")
  • Error tool result detection
  • Compaction event detection
  • Summary record handling (branch + sessionId propagation)
  • Malformed JSON line tolerance
  • Empty file handling
  • Timestamp normalization (ISO strings, epoch seconds, epoch milliseconds)
  • Content preview truncation
  • Async parser parity with sync parser
  • findSessionFiles directory traversal including subagent dirs

Brings total test count from 70 → 89 (all passing).

Covers JSONL parsing, event extraction, correction detection, timestamp
normalization (epoch s/ms/ISO), sub-agent spawn detection, compaction
events, malformed line handling, findSessionFiles, and async parser
parity. Brings total test count from 70 to 89.
@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Superseded by #85. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant