feat: add toolkit node tracking to execution telemetry#9073
feat: add toolkit node tracking to execution telemetry#9073benceruleanlu merged 1 commit intomainfrom
Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/22/2026, 03:56:59 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
|
Playwright: ✅ 528 passed, 0 failed · 3 flaky 📊 Browser Reports
|
📝 WalkthroughWalkthroughAdds canonical toolkit node constants, extends telemetry types to carry toolkit metrics, implements toolkit-node detection and counting in the Mixpanel telemetry provider, and adds comprehensive tests covering detection, deduplication, blueprint mapping, and fallback behaviors. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
📦 Bundle: 4.37 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 21.5 kB (baseline 21.5 kB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 942 kB (baseline 942 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 68.8 kB (baseline 68.8 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 436 kB (baseline 436 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Editors & Dialogs — 738 B (baseline 738 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
UI Components — 43.2 kB (baseline 43.2 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 2.51 MB (baseline 2.51 MB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 57.7 kB (baseline 57.7 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.83 MB (baseline 8.83 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.61 MB (baseline 7.61 MB) • ⚪ 0 BBundles that do not match a named category
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/constants/toolkitNodes.ts`:
- Around line 13-20: The entry 'image compare' in TOOLKIT_NODE_NAMES likely has
incorrect casing and will fail case-sensitive set membership checks; verify the
canonical node type string (e.g., "Image Compare") and update the
TOOLKIT_NODE_NAMES set to the exact canonical casing, or instead normalize case
when checking membership (update the detection code that references
TOOLKIT_NODE_NAMES to compare using a consistent transform such as
.toLowerCase() against a lowercased set). Ensure you reference the
TOOLKIT_NODE_NAMES constant and the specific 'image compare' entry when making
the change.
In `@src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.test.ts`:
- Around line 1-68: Wrap the module-level mutable test state in a vi.hoisted()
container: replace the top-level mutable variables mockNodeDefsByName and
mockNodes with a single hoisted object (e.g., const hoisted = vi.hoisted(() =>
({ mockNodeDefsByName: {}, mockNodes: [] }))) and update all mocks and test
helpers to reference hoisted().mockNodeDefsByName and hoisted().mockNodes; also
update the beforeEach reset logic to clear hoisted().mockNodeDefsByName and
hoisted().mockNodes instead of the original top-level variables so each test
gets an isolated containerized state; ensure functions that read these
(useNodeDefStore and reduceAllNodes) access the hoisted properties.
| export const TOOLKIT_NODE_NAMES: ReadonlySet<string> = new Set([ | ||
| // Image Tools | ||
| 'ImageCrop', | ||
| 'ImageRotate', | ||
| 'ImageBlur', | ||
| 'ImageInvert', | ||
| 'image compare', | ||
| 'Canny', |
There was a problem hiding this comment.
Confirm canonical casing for image compare.
Set membership is case-sensitive; if the node type is actually Image Compare (or similar), this entry won’t match and toolkit detection will miss it. Please verify the canonical node type and adjust or normalize casing in detection.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/constants/toolkitNodes.ts` around lines 13 - 20, The entry 'image
compare' in TOOLKIT_NODE_NAMES likely has incorrect casing and will fail
case-sensitive set membership checks; verify the canonical node type string
(e.g., "Image Compare") and update the TOOLKIT_NODE_NAMES set to the exact
canonical casing, or instead normalize case when checking membership (update the
detection code that references TOOLKIT_NODE_NAMES to compare using a consistent
transform such as .toLowerCase() against a lowercased set). Ensure you reference
the TOOLKIT_NODE_NAMES constant and the specific 'image compare' entry when
making the change.
src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.test.ts
Show resolved
Hide resolved
Add has_toolkit_nodes, toolkit_node_names, and toolkit_node_count to execution context and run button events. Toolkit nodes are identified by a hardcoded set of node type names and by python_module matching comfy_essentials for blueprint nodes. Amp-Thread-ID: https://ampcode.com/threads/T-019c832e-de07-776b-ba61-088be848f96f
9825076 to
afee55d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts`:
- Around line 292-294: The Run Button telemetry payload in
MixpanelTelemetryProvider (around the trackRunButton/RUN_BUTTON_CLICKED
handling) omits the toolkit_node_count from ExecutionContext; update the payload
construction to include toolkit_node_count: executionContext.toolkit_node_count
(alongside has_toolkit_nodes and toolkit_node_names) so the RunButtonProperties
sent by trackRunButton contains the toolkit count for consistent analytics.
Summary
Add toolkit (Essentials) node tracking to execution telemetry, enabling measurement of toolkit node adoption and popularity.
Changes
has_toolkit_nodes,toolkit_node_names, andtoolkit_node_countfields toExecutionContextandRunButtonProperties. Toolkit nodes are identified via a hardcoded set of node type names (10 novel Essentials nodes) and bypython_module === 'comfy_essentials'for blueprint nodes. Detection runs inside the existingreduceAllNodes()traversal — no additional graph walks.Review Focus
TOOLKIT_NODE_NAMESset andTOOLKIT_BLUEPRINT_MODULESfor blueprintsapi_node_namesandtoolkit_node_namespython_moduleautomatically picks up new essentials blueprints without code changes┆Issue is synchronized with this Notion page by Unito