{"record":{"id":"246f760a6282fa5c","repo":"windmill-labs/windmill","slug":"no-pipeline-editor-is-open-pipeline-tools-only-wo","errorCode":null,"errorMessage":"No pipeline editor is open. Pipeline tools only work on a /pipeline/<folder> page in edit mode.","messagePattern":"No pipeline editor is open\\. Pipeline tools only work on a /pipeline/<folder> page in edit mode\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/pipeline/core.ts","lineNumber":82,"sourceCode":"\t}) => Promise<{ path: string; detectedReads: string[]; detectedWrites: string[] }>\n\t/** Replace an existing node's body, applied as an unsaved draft. Returns the\n\t * re-inferred asset lineage (URIs) so the caller sees the effect of the edit. */\n\teditNode: (\n\t\tpath: string,\n\t\tcontent: string\n\t) => Promise<{ detectedReads: string[]; detectedWrites: string[] }>\n\t/** Discard the unsaved draft at a path (undo a build_pipeline_node). */\n\tremoveProposedNode: (path: string) => Promise<void>\n\t/** Preview-run a node (draft body preferred). Returns the started job id. */\n\ttestNode: (path: string, args?: Record<string, any>) => Promise<string | undefined>\n}\n\n/** Helper bag the pipeline tools receive from the manager in global mode. */\nexport type PipelineToolHelpers = { pipeline?: PipelineAIChatHelpers }\n\nfunction requirePipeline(helpers: PipelineToolHelpers): PipelineAIChatHelpers {\n\tif (!helpers?.pipeline) {\n\t\tthrow new Error(\n\t\t\t'No pipeline editor is open. Pipeline tools only work on a /pipeline/<folder> page in edit mode.'\n\t\t)\n\t}\n\treturn helpers.pipeline\n}\n\nconst scriptLangSchema = z.enum($ScriptLang.enum)\n\nconst outputKindSchema = z\n\t.enum(['none', 'datatable', 'ducklake', 'materialize', 's3_parquet', 's3_object'])\n\t.describe(\n\t\t'Kind of output asset this node materializes, used to seed the output edge on the canvas before the body is parsed: \"materialize\"/\"ducklake\" → a DuckLake table, \"datatable\" → a Postgres data table, \"s3_parquet\"/\"s3_object\" → an S3 file, \"none\" → side-effect only. Defaults to none.'\n\t)\n\n// ----------------------------------------------------------------------------\n// Read tools\n// ----------------------------------------------------------------------------\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/pipeline/core.ts#L64-L100","documentation":"The Windmill AI chat pipeline tools operate on a live pipeline editor instance. The manager injects that instance into the tool helpers only when a /pipeline/<folder> page is open in edit mode; when it is absent, requirePipeline throws this error instead of letting the tool run against nothing.","triggerScenarios":"Any pipeline tool (test node, edit pipeline, etc.) invoked while helpers.pipeline is undefined — i.e. the chat is in global/session mode but the user is not on a pipeline editor page in edit mode, or the editor failed to register its helpers.","commonSituations":"Developer asks the copilot to modify or test a pipeline from another page (script editor, home, flows list); the pipeline tab is open in run/view mode rather than edit mode; the editor component has not mounted its helpers yet when the tool fires.","solutions":["Open the target pipeline at /pipeline/<folder> and switch it into edit mode before invoking pipeline tools","Confirm the chat session is connected to the open editor (helpers.pipeline is registered by the editor component on mount)","Reload the pipeline page if the editor is open but helpers were not injected (stale frontend state)","Route the request to a chat session scoped to the pipeline editor instead of a global chat"],"exampleFix":"// before (global chat, no editor)\nawait chat.run('test the transform node') // -> throws\n// after\n// open /pipeline/my-folder in edit mode, then use that page's chat\nawait chat.run('test the transform node')","handlingStrategy":"validation","validationCode":"if (!helpers?.pipeline) {\n  // route the user to open /pipeline/<folder> in edit mode first\n  return\n}\n// safe to call pipeline tools","typeGuard":"function hasPipeline(helpers) {\n  return typeof helpers === 'object' && helpers !== null && 'pipeline' in helpers && helpers.pipeline != null\n}","tryCatchPattern":null,"preventionTips":["Only invoke pipeline tools from a chat attached to a pipeline editor in edit mode","Check helpers.pipeline presence before dispatching any pipeline tool call","Prompt users to open the pipeline editor when their request references pipeline operations"],"tags":["pipeline","ai-copilot","missing-context","frontend"],"backgroundTag":"missing-editor-context","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"}