fix(pi): parse OMP title-before-session logs#231
Open
timseriakov wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why this happened
The original Pi/OhMyPi parser assumed every session JSONL starts with a
sessionrecord on the first line. That matched the Pi logs I tested first.Oh My Pi changed its session log stream to emit title metadata as its own JSONL record before the session header, for example:
{"type":"title","v":1,"title":"brief-improve","source":"user","updatedAt":"..."} {"type":"session","version":3,"id":"...","timestamp":"...","cwd":"..."}So the file is still a valid session log, but line 1 is no longer the
sessionheader. Codbash treated that firsttitlerecord as an invalid header and returnednull, silently dropping the whole session from scans. Locally this matched the missing-session symptom: Pi/OhMyPi counts went from the old undercount topi count: 555,ohmy: 431after parsing the delayed session header.Fix
{ type: 'session', id }record instead of requiring it at line 1titlemetadata recordValidation
node --check src/data.jsnode --test test/pi-session.test.js→ 14 pass, 0 failpi count: 555,ohmy: 431