Repository navigation
fix(web): notebook error tracebacks no longer show color codes - #36698
StiensWout wants to merge 2 commits into
Conversation
IPython colors every saved traceback frame with ANSI SGR sequences, and the notebook preview printed them raw into a plain <pre>. Strip SGR from error traceback frames only; stream text, sources and literal escape spellings stay as saved, and the frame newline boundary is unchanged. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Co-authored-by: GPT 6.1 Sol <codex@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Notebook error previews now remove terminal color codes while preserving separation between traceback frames. This is a localized display correction with no changes to stored notebook data or product defaults. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for this. #31929 makes the same change and is the one being kept. #31929 fixes the same saved-notebook traceback problem. It uses the existing shared plain-text helper and extends that helper to support colon-form SGR colors, keeping this cleanup in one place. Your source-preservation and literal-escape assertions are useful additions that could strengthen the retained fix. Closing as a duplicate. |
Saved IPython notebook errors display raw terminal color codes, making their tracebacks hard to read. Strip SGR sequences from traceback frames before joining them, keeping the existing frame-boundary behavior. Cell sources, literal escape spellings and other output kinds retain their existing handling.
Found by the GPT 6.1 Sol bughunt and independently confirmed by Claude Opus 5.5 with a freshly produced default IPython notebook. Small fast-lane fix in the existing parser helper, with no new state or UI flow.
Proof
notebook-error-ansi.e2e.tsscenario through Files:pnpm exec vp run scenarios:prove scripts/scenarios/notebook-error-ansi.e2e.ts --base 8cb551a3cec68767054b67b790b8293ac1e7859a --head HEADfails on base and passes on head.ZeroDivisionError: division by zero.pnpm exec vp run check:changedpasses.Captures show the equivalent reviewed patch before its unchanged rebase. Temporary diagnostics and scenario are proof artifacts, not committed renderer tests. Only saved error outputs are proved; no claim about ANSI in streams or non-SGR terminal controls. Source highlighting was still loading when the captures were taken.
Council review
No blockers or shoulds. Opus nits retained: SGR-only frames retain existing blank-line behavior; the shared terminal helper accepts different SGR syntax, so reusing it is a separate change. Stream ANSI handling remains outside this fix.
Created with GPT 6.1 Sol (lead, bughunt and review) and Claude Opus 5.5 (verification, build, trim and review) in T3 Code through the Codex and Claude harnesses.
Closes #36697