Skip to content

fix(observe): report invalid trace encoding without a traceback - #136

Merged
Shashankss1205 merged 2 commits into
mainfrom
fix/trace-utf8-errors
Oct 9, 2026
Merged

Shashankss1205 merged 2 commits into
mainfrom
fix/trace-utf8-errors

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Invalid UTF-8 in a trace currently escapes the structured error boundary: trace, metrics and viz --json crash with empty stdout instead of returning the promised error document. Decode each JSONL line inside the TraceReadError boundary so the refusal names the actual 1-based line and retains the original decoding cause.

Preserve strict refusal of a corrupt file, valid Unicode content, Unicode blank lines, LF/CRLF/CR line boundaries, and a valid final event without a trailing newline. Add API and CLI regression coverage, document the error behavior, and refresh the selected-test figure.

Validation: 24 cases failed on unmodified main; all 27 new checks now pass. The focused trace/replay/CLI/documentation run passed 256 tests. ruff check . and git diff --check passed. Paid live tests were excluded.

Fixes #134.

Decode and validate each trace line inside the TraceReadError boundary. Preserve LF, CRLF, CR, Unicode content, blank lines and a valid unterminated last event. Trace, metrics and viz now report invalid UTF-8 as a structured exit-2 error rather than a raw decoding traceback.

Fixes #134.
@Shashankss1205
Shashankss1205 merged commit 1498c43 into main Oct 9, 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.

cli: non-UTF-8 traces escape the structured error boundary

1 participant