Skip to content

Stop logging unhandled ComfyUI websocket messages at Warn - #1797

Merged
mohnjiles merged 2 commits into
LykosAI:mainfrom
deepratna-awale:quiet-comfy-websocket-logging
Nov 15, 2026
Merged

mohnjiles merged 2 commits into
LykosAI:mainfrom
deepratna-awale:quiet-comfy-websocket-logging

Conversation

@deepratna-awale

@deepratna-awale deepratna-awale commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1796 for #1790. It addresses what is likely the main source of the log volume reported there.

ComfyClient.HandleTextMessage only acts on executing, status, progress and execution_error. Every other websocket message fell through to:

Logger.Warn($"Unknown message type {json.Type} ({json.Data}), skipping");

That wrote the full pretty-printed JSON payload to app.log at Warn, so no log level setting could hide it. This affected normal ComfyUI traffic (execution_start, execution_cached, executed, execution_success, progress_state) and custom-node broadcasts such as resource monitors that send a message every second. progress_state lists every node in the workflow, so one generation of a large workflow could add thousands of lines.

Changes

  • Added ExecutionSuccess, ExecutionInterrupted and ProgressState to ComfyWebSocketResponseType.
  • Standard ComfyUI message types the client doesn't use are now skipped silently.
  • Any other type, e.g. custom-node broadcasts, is logged at Trace with only its type. The full message is still available at Trace from the existing Received json message line.
  • Invalid JSON is still logged at Warn.
  • HandleTextMessage is now internal so it can be tested (Core already has InternalsVisibleTo for the test project).

Testing

  • New ComfyClientMessageLoggingTests covers each standard type and a custom-node type logging nothing above Trace, the custom type logging its type without the payload, invalid JSON still warning, and the new enum values deserializing. On the previous code, 8 of these tests fail.
  • Replayed one 20-step generation plus 60 seconds of monitor messages (84 messages) through the app's logging setup. Before: 84 Warn entries and 468 lines in app.log. After: none.
  • Full test suite: the only failures are the network-dependent PackageLinkTests (TestLicenseUrl / TestPreviewImageUri), which couldn't reach the internet in my test environment and are unrelated.

@mohnjiles

Copy link
Copy Markdown
Member

This commit doesn't depend on anything in #1796. It only touches ComfyClient, the response type enum and its test. Could you rebase it onto main on its own? It's the actual fix for the log volume in #1790, and we'd like to take it independently of the setting.

Two small things while you're there:

  • Custom-node message types deserialize to Unknown, so the new Trace line always prints "Skipping unhandled message type Unknown". Logging the raw type string, or dropping the line, would be more useful. The full payload is already logged at Trace just above.
  • execution_interrupted is worth keeping at Debug rather than silent, because it helps when someone reports a generation that stopped.

HandleTextMessage only acts on executing, status, progress and
execution_error. Every other message fell through to a Warn that included
the full pretty-printed JSON payload, so normal ComfyUI traffic
(execution_start, execution_cached, executed, execution_success,
progress_state) and custom node broadcasts such as resource monitors
that send a message every second filled app.log.

Recognise the standard ComfyUI message types the client doesn't use and
skip them silently, and log any other type at Trace with only its type.
The full message is still available at Trace from the existing
"Received json message" line. Invalid JSON is still logged at Warn.
… Debug

Custom node message types all deserialize to Unknown, so read the type
string from the message when logging it at Trace. Log execution_interrupted
at Debug with its prompt and node ids, since it helps when diagnosing a
generation that stopped.
@deepratna-awale
deepratna-awale force-pushed the quiet-comfy-websocket-logging branch from ed9e80c to 8d5dbea Compare November 11, 2026 20:33

Copy link
Copy Markdown
Member

The Build workflow hit a GitHub startup error before creating any jobs, and the retry is stuck queued. Briefly closing and reopening this PR to request a fresh Build run, then rechecking CLA as needed. No code changes or merge intended.

@mohnjiles mohnjiles closed this Nov 15, 2026
@mohnjiles mohnjiles reopened this Nov 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 15, 2026

Copy link
Copy Markdown
Member

recheck

@mohnjiles
mohnjiles enabled auto-merge November 15, 2026 03:18
@mohnjiles
mohnjiles merged commit 54c66e2 into LykosAI:main Nov 15, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants