Skip to content

feat: warn on skipped malformed JSON lines in session logs#27

Merged
dbroeglin merged 1 commit into
mainfrom
dbroeglin-musical-sniffle
Jul 5, 2026
Merged

feat: warn on skipped malformed JSON lines in session logs#27
dbroeglin merged 1 commit into
mainfrom
dbroeglin-musical-sniffle

Conversation

@dbroeglin

Copy link
Copy Markdown
Owner

This PR improves the robustness of events.jsonl parsing by adding a rich console warning when malformed JSON lines are encountered and skipped.

Previously, load_events() in sessionlog.py silently caught json.JSONDecodeErrors, which could leave researchers unaware if their session logs were truncated (e.g., from an abrupt agent exit or OOM kill). With this change, a warning message is emitted to stderr specifying the file name and the number of skipped lines.

Changes:

  • Added a skipped_lines counter in load_events().
  • Emits a warning via rich.console.Console(stderr=True) if any lines are skipped.
  • Updated unit tests in test_sessionlog.py to capture and verify the stderr warnings.

@dbroeglin
dbroeglin merged commit 88807fd into main Jul 5, 2026
7 checks passed
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