Skip to content

ComfyUI execution errors surface raw message payloads; add a compact summary #615

Description

@Alan5168

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions