Skip to content

fix: use safe .get() for 'mode' query param in fetch_customnode_list#2741

Open
HuangYuChuh wants to merge 1 commit into
Comfy-Org:mainfrom
HuangYuChuh:fix/keyerror-mode-query-param
Open

fix: use safe .get() for 'mode' query param in fetch_customnode_list#2741
HuangYuChuh wants to merge 1 commit into
Comfy-Org:mainfrom
HuangYuChuh:fix/keyerror-mode-query-param

Conversation

@HuangYuChuh
Copy link
Copy Markdown

Summary

  • Fix KeyError: 'mode' crash in /customnode/getlist endpoint when the mode query parameter is not provided
  • Extract the mode value once using .get("mode", "cache") with a default fallback, consistent with how skip_update is already handled on the same endpoint
  • Eliminates repeated request.rel_url.query["mode"] lookups by storing in a local variable

Fixes #2740

Test plan

  • Send GET request to /customnode/getlist without mode param — should no longer crash
  • Send GET request to /customnode/getlist?mode=local — should work as before
  • Send GET request to /customnode/getlist?mode=cache — should work as before
  • Verify custom node list loads correctly in Manager UI

🤖 Generated with Claude Code

The `/customnode/getlist` endpoint crashes with `KeyError: 'mode'`
when the `mode` query parameter is missing from the request. Extract
the mode value once using `.get()` with a default fallback, consistent
with how `skip_update` is already handled on the same endpoint.

Fixes Comfy-Org#2740

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: KeyError 'mode' in fetch_customnode_list when query parameter is missing

1 participant