Skip to content

Commit 1ca0641

Browse files
FL4TLiN3claude
andauthored
chore: add parse failure logging to E2E event parser (#713)
* chore: use stderr for E2E debug logging to ensure visibility in CI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: add parse failure logging to event parser Log details when startRun/completeRun/stopRun events fail to parse, to diagnose CI-only E2E failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d10ec17 commit 1ca0641

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

e2e/lib/event-parser.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ function tryParseEvent(text: string, events: ParsedEvent[]): void {
5555
if (data.type) {
5656
events.push({ ...data, raw: text })
5757
}
58-
} catch {}
58+
} catch (e) {
59+
if (
60+
text.includes('"startRun"') ||
61+
text.includes('"completeRun"') ||
62+
text.includes('"stopRun')
63+
) {
64+
process.stderr.write(
65+
`[PARSE_FAIL] Failed to parse event (len=${text.length}): ${(e as Error).message}\n`,
66+
)
67+
process.stderr.write(`[PARSE_FAIL] first 200 chars: ${text.slice(0, 200)}\n`)
68+
process.stderr.write(`[PARSE_FAIL] last 200 chars: ${text.slice(-200)}\n`)
69+
}
70+
}
5971
}
6072

6173
export function filterEventsByType<T extends RunEvent["type"]>(

0 commit comments

Comments
 (0)