Skip to content

skill-doctor: parse full Claude/Codex JSONL sessions, not just first 8MB - #88

Draft
warp-factories[bot] wants to merge 1 commit into
mainfrom
factory/skill-doctor-parse-full-jsonl
Draft

skill-doctor: parse full Claude/Codex JSONL sessions, not just first 8MB#88
warp-factories[bot] wants to merge 1 commit into
mainfrom
factory/skill-doctor-parse-full-jsonl

Conversation

@warp-factories

Copy link
Copy Markdown

Problem

collect_sessions.py truncated each Claude Code and Codex JSONL session file to MAX_FILE_BYTES (8MB) before splitting it into lines and parsing. For sessions whose raw file exceeds 8MB, every record past that byte offset was silently dropped from the generated transcript, even though the file is well-formed JSONL.

Fix

Removed the pre-parse truncation in parse_claude_session() and parse_codex_session(). The full file is now read and every line is parsed. The generated transcript stays condensed independently via the existing per-entry character limits (MAX_MSG_CHARS, MAX_TOOL_CHARS) and the head/tail cap on total entries (MAX_TRANSCRIPT_ENTRIES), so this does not change report size, only which messages get considered.

Testing

Added two regression tests in test_collect_sessions.py that pad a synthetic session past the old 8MB cutoff with filler tool calls, then assert a trailing message is still present in the parsed entries (one for the Claude parser, one for the Codex parser). Ran the full test_collect_sessions.py suite locally — all 7 tests pass.

Closes #87

collect_sessions.py truncated each Claude Code and Codex JSONL session
file to MAX_FILE_BYTES (8MB) before splitting into lines and parsing,
silently dropping any messages/tool calls past that offset for long
sessions. The rendered transcript is already condensed independently
(per-entry char limits and a head/tail cap on total entries), so the
raw-file truncation was unnecessary and just caused data loss.

Remove the pre-parse truncation in parse_claude_session() and
parse_codex_session() so the full file is parsed; add regression tests
that pad a session past the old 8MB cutoff and assert a trailing
message still shows up in the parsed entries.

Fixes #87
@warp-factories warp-factories Bot added the factory:revops-factory Managed by revops-factory label Aug 30, 2026
@warp-factories

Copy link
Copy Markdown
Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation View GitHub Issue

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

Labels

factory:revops-factory Managed by revops-factory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skill-doctor truncates long sessions before parsing, silently omitting messages

0 participants