feat: add essentials_category to nodes and blueprints for Essentials tab#12573
feat: add essentials_category to nodes and blueprints for Essentials tab#12573christian-byrne wants to merge 1 commit intomasterfrom
Conversation
Add ESSENTIALS_CATEGORY or essentials_category to 12 node classes and all 36 blueprint JSONs. Update SubgraphEntry TypedDict and subgraph_manager to extract and pass through the field. Fixes COM-15221 Amp-Thread-ID: https://ampcode.com/threads/T-019c83de-f7ab-7779-a451-0ba5940b56a9
📝 WalkthroughWalkthroughThe PR introduces an optional 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/subgraph_manager.py (1)
106-115: Avoid swallowing blueprint parse errors silently.
The blanketexcept Exception: passmakes JSON/IO issues hard to diagnose. Consider narrowing the exception and logging at least at debug level.💡 Suggested tweak
+import logging ... +logger = logging.getLogger(__name__)- except Exception: - pass + except (OSError, json.JSONDecodeError) as exc: + logger.debug("Failed to read essentials_category from %s: %s", file, exc)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/subgraph_manager.py` around lines 106 - 115, The try/except is currently swallowing all errors when reading/parsing blueprint files; change the block around opening/parsing the file (the with open(...) as f, json.load into bp_data, subgraphs extraction and setting entry['essentials_category']) to catch specific errors (json.JSONDecodeError and OSError) and log the exception at debug or warning level (e.g., logger.debug or logger.warning) including the filename and error details, while allowing truly unexpected exceptions to propagate (or re-raise them) so they are not silently ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/subgraph_manager.py`:
- Around line 106-115: The try/except is currently swallowing all errors when
reading/parsing blueprint files; change the block around opening/parsing the
file (the with open(...) as f, json.load into bp_data, subgraphs extraction and
setting entry['essentials_category']) to catch specific errors
(json.JSONDecodeError and OSError) and log the exception at debug or warning
level (e.g., logger.debug or logger.warning) including the filename and error
details, while allowing truly unexpected exceptions to propagate (or re-raise
them) so they are not silently ignored.
Summary
Add
essentials_category/ESSENTIALS_CATEGORYto 12 node classes and all 36 blueprint JSONs so the frontend Essentials tab can categorize and order them correctly.Changes
Node classes (12 total):
nodes.py: LoadImage, SaveImage, PreviewImage, LoadImageMasknodes_post_processing.py: ImageBlend, ImageCropV2, ImageScaleBynodes_video.py: Video Slicenodes_audio.py: EmptyLatentAudio, SaveAudioMP3nodes_images.py: ImageCompare (via nodes_image_compare.py)nodes_recraft.py: RecraftVectorizeImageNodenodes_kling.py: KlingOmniProEditVideoNodeBlueprints (36 JSONs):
essentials_categoryfield todefinitions.subgraphs[0]in every blueprintBackend plumbing:
app/subgraph_manager.py: Addedessentials_categorytoSubgraphEntryTypedDict and extraction logic inget_blueprint_subgraphsFixes COM-15221
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms