{"record":{"id":"55908e86136b8a50","repo":"windmill-labs/windmill","slug":"no-flow-helpers-found","errorCode":null,"errorMessage":"No flow helpers found","messagePattern":"No flow helpers found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts","lineNumber":3417,"sourceCode":"\t\t\t\t\tentityId: chatId,\n\t\t\t\t\tworkspace: this.operatingWorkspace\n\t\t\t\t})\n\t\t\t}\n\t\t\tif (this.isSessionChat && this.sessionId) {\n\t\t\t\tlogFeatureUsage('ai_session', 'message', {\n\t\t\t\t\tkey: this.mode,\n\t\t\t\t\tentityId: this.sessionId,\n\t\t\t\t\tworkspace: this.operatingWorkspace\n\t\t\t\t})\n\t\t\t\tlogFeatureUsage('ai_session', 'autonomy', {\n\t\t\t\t\tkey: this.autonomyMode,\n\t\t\t\t\tentityId: this.sessionId,\n\t\t\t\t\tworkspace: this.operatingWorkspace\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (this.mode === AIMode.FLOW && !this.flowAiChatHelpers) {\n\t\t\t\tthrow new Error('No flow helpers found')\n\t\t\t}\n\n\t\t\tlet snapshot:\n\t\t\t\t| { type: 'flow'; value: ExtendedOpenFlow }\n\t\t\t\t| { type: 'app'; value: number }\n\t\t\t\t| undefined = undefined\n\t\t\tif (this.mode === AIMode.FLOW) {\n\t\t\t\tsnapshot = { type: 'flow', value: this.flowAiChatHelpers!.getFlowAndSelectedId().flow }\n\t\t\t\tthis.flowAiChatHelpers!.setSnapshot(snapshot.value)\n\t\t\t} else if (this.mode === AIMode.APP) {\n\t\t\t\tsnapshot = { type: 'app', value: this.appAiChatHelpers!.snapshot() }\n\t\t\t}\n\n\t\t\t// Attach the enrichments that are only known after beforeSend (selected\n\t\t\t// context + snapshot) to the optimistic user message pushed before it.\n\t\t\tthis.displayMessages = this.displayMessages.map((m, i) =>\n\t\t\t\ti === optimisticIndex\n\t\t\t\t\t? {","sourceCodeStart":3399,"sourceCodeEnd":3435,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts#L3399-L3435","documentation":"sendRequest throws this when mode is AIMode.FLOW but the manager's flowAiChatHelpers were never injected. Flow-mode AI editing needs helpers provided by the flow editor (step selection, flow mutation); without them the manager cannot read or modify the flow, so it refuses early.","triggerScenarios":"Calling sendRequest (or the AI chat) with mode=FLOW while AIChatManager was constructed outside the flow editor context — e.g. mounted in a script/app page, or the flow editor component did not set flowAiChatHelpers before the first send.","commonSituations":"Embedding the AI chat panel in a custom page without wiring the flow helpers; opening the chat before the flow editor finished initializing; a bug where the helper binding is cleared on editor remount.","solutions":["Open the AI chat from within the flow editor so the flow helpers are injected.","Ensure the flow editor assigns flowAiChatHelpers on the manager before any send.","Send with mode SCRIPT or APP if you are not editing a flow.","If embedding the chat yourself, pass the FlowAIChatHelpers implementation to the manager."],"exampleFix":"// before\nmanager.sendRequest({ instructions: 'add a step', mode: AIMode.FLOW }) // throws outside flow editor\n// after\nif (isInFlowEditor) {\n  await manager.sendRequest({ instructions: 'add a step', mode: AIMode.FLOW })\n} else {\n  await manager.sendRequest({ instructions: 'generate a script', mode: AIMode.SCRIPT, lang: 'bun' })\n}","handlingStrategy":"validation","validationCode":"if (manager.mode === AIMode.FLOW && !manager.flowAiChatHelpers) {\n  throw new Error('Flow AI requires the flow editor context')\n}","typeGuard":null,"tryCatchPattern":"try {\n  await manager.sendRequest({ instructions, mode: AIMode.FLOW })\n} catch (e) {\n  if (e.message === 'No flow helpers found') {\n    openInFlowEditor(); return\n  }\n  throw e\n}","preventionTips":["Mount the AI chat only inside the flow editor for FLOW mode.","Assert flowAiChatHelpers is set during app initialization in flow pages.","Fall back to SCRIPT mode when no flow editor is present."],"tags":["ai","flow","missing-dependency","copilot"],"backgroundTag":"missing-dependency-injection","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}