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_error payload, extract node_type, exception_type, and the first line of exception_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.
Current behavior
When a ComfyUI prompt fails,
_history_entry()raiseswhere
msgsis the rawstatus.messageslist from/history. For anexecution_errorthis 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:execution_errorpayload, extractnode_type,exception_type, and the first line ofexception_message→ e.g.KSampler: ValueError: expected float tensorResult:
ComfyUI execution error: KSampler: ValueError: <first line>instead of a wall of raw JSON, whileprompt_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.