{"record":{"id":"316bbd67ec5c9bf1","repo":"windmill-labs/windmill","slug":"script-path-is-not-deployed-there-is-no-newe","errorCode":null,"errorMessage":"Script \"${path}\" is not deployed; there is no newer version to rebase onto.","messagePattern":"Script \"(.+?)\" is not deployed; there is no newer version to rebase onto\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/global/core.ts","lineNumber":6232,"sourceCode":"\t\t\treturn rebaseScriptDraft(args.path, ctx)\n\t\tcase 'flow':\n\t\t\treturn rebaseFlowDraft(args.path, ctx)\n\t\tcase 'app':\n\t\t\treturn rebaseAppDraft(args.path, ctx)\n\t\tdefault:\n\t\t\tthrow new Error('rebase_draft currently supports scripts, flows, and apps.')\n\t}\n}\n\nasync function rebaseScriptDraft(path: string, ctx: WriteDraftCtx): Promise<string> {\n\tconst { workspace, toolId, toolCallbacks } = ctx\n\n\tconst draft = await getGlobalDraft(workspace, 'script', path)\n\tif (!draft || typeof draft.value !== 'string' || !draft.language) {\n\t\tthrow new Error(`No script draft found for \"${path}\".`)\n\t}\n\tif (!(await ScriptService.existsScriptByPath({ workspace, path }))) {\n\t\tthrow new Error(`Script \"${path}\" is not deployed; there is no newer version to rebase onto.`)\n\t}\n\n\tconst latest = await ScriptService.getScriptByPath({ workspace, path })\n\tconst baseHash = draft.parentHash\n\tif (baseHash && baseHash === latest.hash) {\n\t\tconst message = `Draft \"${path}\" is already based on the latest deployed version (${latest.hash}).`\n\t\ttoolCallbacks.setToolStatus(toolId, { content: message })\n\t\treturn JSON.stringify({ success: true, alreadyLatest: true, latest_hash: latest.hash, message })\n\t}\n\n\ttoolCallbacks.setToolStatus(toolId, { content: `Rebasing draft \"${path}\" onto latest...` })\n\n\t// Capture the draft's own changes (vs its fork base) BEFORE discarding — this\n\t// diff is the only clean record of what to replay. Best-effort: if the base\n\t// version is gone, diff against empty so the full draft is surfaced.\n\tlet baseContent = ''\n\tif (baseHash) {\n\t\ttry {","sourceCodeStart":6214,"sourceCodeEnd":6250,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/global/core.ts#L6214-L6250","documentation":"Thrown by rebaseScriptDraft when the script has a draft but no deployed version — rebase exists to port draft changes onto a deploy that moved ahead of the draft's fork base, and with no deploy there is no newer target. The draft is already based on the only state that exists, so rebasing is meaningless rather than merely impossible.","triggerScenarios":"Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Deploy the script first; rebase only matters once a newer deploy exists","Skip rebasing — the draft is already current, so just deploy the draft","If you expected a deploy to exist, check you are targeting the right path and workspace"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}