Fix dropped error hints and improve error output UI#9673
Conversation
This change improves how statically parsed errors and exceptions are rendered in marimo's frontend, making them more compact, more legible, and conveying more information. Python's "Did you mean: ..." suggestions for NameError, AttributeError, and similar exceptions were never reaching the frontend; this change fixes that. The rest of the change tidies how errors are presented, making them more compact and legible. The console-area traceback loses its collapsible accordion, which only repeated the exception message already shown above it. The output area loses its "See console area for traceback", unless outputs are configured to be shown above the cell. Static errors (multiple definitions, cycles, setup-cell references, star imports) no include the aggressive red "This cell wasn't run because it has errors text". Instead, a subtle cell not run title is included, with a tooltip provided more context.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This pull request improves how exceptions and statically parsed errors are surfaced end-to-end: it preserves Python’s “Did you mean: …” hints in backend error messages and adjusts the frontend error/traceback UI to be more compact and less visually aggressive.
Changes:
- Preserve Python exception “Did you mean: …” suggestions by formatting exception messages via
traceback.TracebackExceptionand using this in post-execution error broadcasting. - Update frontend traceback/error rendering to reduce redundancy (remove traceback accordion header, conditionally show “See console area…” hint, add a subtle “Cell not run” overline for static errors).
- Tweak error-related styling (reduced red emphasis in cell outlines and active error line highlighting).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/_runtime/test_runtime.py | Adds runtime regression test for NameError suggestion propagation. |
| tests/_messaging/test_tracebacks.py | Adds unit tests for format_exception_message() behavior. |
| marimo/_runtime/runner/hooks_post_execution.py | Uses format_exception_message() when constructing exception error payloads. |
| marimo/_messaging/tracebacks.py | Introduces format_exception_message() using TracebackException to retain hints. |
| frontend/src/css/app/Cell.css | Softens cell error outline styling by removing red background fill. |
| frontend/src/core/codemirror/cells/traceback-decorations.ts | Adjusts focused error-line highlight color intensity. |
| frontend/src/components/editor/output/MarimoTracebackOutput.tsx | Simplifies traceback display by removing the accordion header/collapse UI. |
| frontend/src/components/editor/output/MarimoErrorOutput.tsx | Conditionally shows console hint, adds “Cell not run” overline + tooltip for static errors, tightens spacing. |
There was a problem hiding this comment.
1 issue found across 8 files
Architecture diagram
sequenceDiagram
participant Client as Client Browser
participant Editor as CodeMirror Editor
participant Component as MarimoErrorOutput
participant Traceback as MarimoTracebackOutput
participant FrontendConfig as Frontend Config Store
participant Kernel as Python Kernel
participant TracebackModule as Traceback Module
participant PostExec as Post-Execution Hook
Note over Client,PostExec: Error display flow with improved hints and compact UI
Client->>Kernel: Execute cell
Kernel->>PostExec: on cell result (exception)
PostExec->>TracebackModule: format_exception_message(exception)
Note over PostExec,TracebackModule: NEW: Uses TracebackException to preserve Python's "Did you mean: ..." hints
TracebackModule-->>PostExec: Formatted message with suggestions
PostExec->>Client: Broadcast error (exception_type, msg, traceback)
Client->>Component: Render error output
Component->>FrontendConfig: Read cell_output display config
FrontendConfig-->>Component: "above" or "below"
alt Static error (multiple-defs, cycle, setup-refs, import-star)
Note over Component: NEW: No alert title, only status overline
Component->>Component: Show "Cell not run" overline
Component->>Component: Show tooltip on InfoIcon
Component->>Component: Render body message (already describes error)
Component-->>Client: Compact error display (reduced padding/spacing)
else Runtime exception
Component->>Component: Show exception type & formatted message
alt Console traceback present
Component->>Component: Render formatted traceback HTML
else No traceback
opt showConsoleHint is true (output above cell)
Component->>Component: Show "See console area for traceback"
end
end
Component->>Component: Show action buttons (copy, search, AI fix, cell link)
Component-->>Client: Error display (reduced vertical spacing, no accordion)
else Ancestor/other errors
Component->>Component: Show descriptive title (changed colors)
Component-->>Client: Error display
end
Note over Client,Traceback: CHANGED: Traceback output no longer wrapped in accordion
Client->>Traceback: Render traceback
Traceback->>Traceback: Format traceback (highlight, link cells, add replacements)
Traceback-->>Client: Direct display (no collapse/expand, no redundant header)
Note over Editor,Component: Editor styling improvements
Client->>Editor: Apply error line decorations
Editor->>Editor: NEW: Reduced background opacity (red-5 instead of red-6)
Editor-->>Client: Error line styling (less aggressive highlight)
Note over Client: Cell container styling
Client->>Client: NEW: Remove red-2 background from error-outline cells
Client-->>Client: Cell still has error shadow but no background tint
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
I don't think we should collapse stacktraces, they are valuable information |
|
Thanks @dylan. I've made the traceback collapsible, thank you for catching that regression.
|
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.9-dev11 |




This change improves how statically parsed errors and exceptions are rendered in marimo's frontend, making them more compact, more legible, and conveying more information.
Motivation. Reactive notebooks can emit many errors. Our errors were taking up a lot of space (padding, redundant information), reducing information density. They were also a bit aggressively red in their styling, especially static errors such as multiple definition errors, which can make users feel alarmed or stressed.
Changes. Python's "Did you mean: ..." suggestions for NameError, AttributeError, and similar exceptions were never reaching the frontend; this change fixes that.
The rest of the change tidies how errors are presented, making them more compact and legible. The console-area traceback loses its collapsible accordion, which only repeated the exception message already shown above it. The output area loses its "See console area for traceback", unless outputs are configured to be shown above the cell.
Static errors (multiple definitions, cycles, setup-cell references, star imports) no longer include the aggressive red "This cell wasn't run because it has errors text". Instead, a subtle cell not run title is included, with a tooltip provided more context.
Examples
Multiple definition error.
With tooltip.
Exceptions.