ComfyUI execution errors surface raw message payloads; add a compact summary
Author: Alan5168Created Sep 3, 2026Updated Sep 3, 2026
Current behavior
When a ComfyUI prompt fails, _history_entry() raises
raise ComfyUIError(f"Execution error: {msgs}", prompt_id=prompt_id)where msgs is the raw status.messages list from /history. For an execution_error this payload embeds the full nested exception content, so the surfaced error can run hundreds of lines of JSON that an operator (or an agent logging the failure) cannot act on.
Proposed change
Add a small compact_execution_error(messages) helper and use it on the error path:
- if the messages contain an
execution_errorpayload, extractnode_type,exception_type, and the first line ofexception_message→ e.g.KSampler: ValueError: expected float tensor - otherwise fall back to JSON-serializing the messages
- truncate at a sane limit (e.g. 1500 chars)
Result: ComfyUI execution error: KSampler: ValueError: <first line> instead of a wall of raw JSON, while prompt_id (for resume) is still preserved.
Happy to send a PR with unit tests covering the execution_error shape, the fallback shape, and the truncation cap.
Source: calesthio/OpenMontage