fix(transcript): skip non-record JSON without losing session usage - #412
DivyamTalwar wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: activeloopai/hivemind/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesTranscript record-shape handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Valid non-record transcript lines can be skipped without losing the tested session usage or fallbacks. No merge-blocking issue is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #411.
A syntactically valid
nullJSONL line throws before the parser can finish the remaining transcript. Malformed JSON is already skipped per line, so this contradicts the existing fail-soft parsing contract and discards otherwise usable session usage.Skip nulls, scalar values and arrays before reading record fields. Valid records before and after the rejected line still contribute, and empty inputs retain their fallback session identity and timestamp.
Version Bump
No release requested. Package versions, dependencies, lockfiles and release workflows are unchanged.
Test plan
The repository-native focused tests report 4 failures and 0 passing controls on unchanged production source; the prepared correction passes all 4 focused tests. The final commit is independently validated by the full Node 22/Linux suite with coverage, typecheck, build, duplication guard and critical-only bundle audit. The workflow enforces zero failed and zero skipped tests.
Exact submitted commit:
988559d10a36ae043420e5e0b8599f9c22205237. Independent Linux job, commands and logs. The checkout is pinned to this commit, not a combined patch branch.The focused tests use isolated files or source fixtures and the real parser/cache/usage code. No customer data, credentials or live model/backend calls are required.
Compatibility and limits
Does not change transcript capture, redaction, supported tool detection, rotation or usage formulas. Corrupt input is skipped; no new transcript schema is introduced.
A clean full macOS suite and native Windows validation are not claimed. Upstream CI approval and maintainer review are separate from this passing independent gate.
Summary by CodeRabbit