{"record":{"id":"cc9e8ff2c8d2e33e","repo":"paperclipai/paperclip","slug":"stage-not-found-on-pipeline-detail-key-opts","errorCode":null,"errorMessage":"Stage not found on pipeline ${detail.key}: ${opts.stage}","messagePattern":"Stage not found on pipeline (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/pipelines.ts","lineNumber":312,"sourceCode":"          title: opts.title ?? \"Pipeline guidance\",\n          body,\n        }), { json: ctx.json });\n      })),\n  );\n\n  addPipelineOptions(\n    pipelines\n      .command(\"set-automation\")\n      .description(\"Set a run_routine onEnter automation on a stage\")\n      .argument(\"<pipeline>\", \"Pipeline ID or key\")\n      .requiredOption(\"--stage <key>\", \"Stage key\")\n      .requiredOption(\"--routine <id>\", \"Routine ID\")\n      .option(\"--note <text>\", \"Automation note\")\n      .action((pipeline: string, opts: AutomationOptions) => withPipelineErrors(async () => {\n        const ctx = resolvePipelineContext(opts);\n        const detail = await getPipeline(ctx, pipeline);\n        const stage = detail.stages?.find((item) => item.key === opts.stage);\n        if (!stage) throw new Error(`Stage not found on pipeline ${detail.key}: ${opts.stage}`);\n        const config = {\n          ...(stage.config ?? {}),\n          onEnter: {\n            ...(asOptionalObject(stage.config?.onEnter) ?? {}),\n            type: \"run_routine\",\n            routineId: opts.routine,\n            ...(opts.note ? { note: opts.note } : {}),\n          },\n        };\n        printOutput(await ctx.api.patch(apiPath`/api/pipelines/${detail.id}/stages/${stage.id}`, { config }), { json: ctx.json });\n      })),\n  );\n\n  addPipelineOptions(\n    pipelines\n      .command(\"ingest\")\n      .description(\"Ingest one case into a pipeline\")\n      .argument(\"<pipeline>\", \"Pipeline ID or key\")","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/pipelines.ts#L294-L330","documentation":"Error \"Stage not found on pipeline ${detail.key}: ${opts.stage}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at cli/src/commands/pipelines.ts:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}