{"record":{"id":"e07f83571e8539ef","repo":"windmill-labs/windmill","slug":"workspace-workspace-is-not-a-fork-it-has-no","errorCode":null,"errorMessage":"Workspace \"${workspace}\" is not a fork — it has no parent workspace to compare against. Use diff without 'against' to compare drafts vs deployed versions.","messagePattern":"Workspace \"(.+?)\" is not a fork — it has no parent workspace to compare against\\. Use diff without 'against' to compare drafts vs deployed versions\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/global/core.ts","lineNumber":6834,"sourceCode":"\t\t\t\t? `No drafts match your filters (${index.entries.length} draft(s) exist in the workspace).`\n\t\t\t\t: 'No drafts in this workspace — nothing differs from the deployed state.'\n\t\t\t: `${total} draft(s) vs deployed:`\n\tconst result = [summaryLine, ...lines, ...notes].join('\\n')\n\ttoolCallbacks.setToolStatus(toolId, {\n\t\tcontent: `Workspace diff: ${total} draft(s)`,\n\t\tresult\n\t})\n\treturn result\n}\n\nfunction forkComparisonUnavailableMessage(parent: string): string {\n\treturn `The comparison with parent workspace \"${parent}\" is unavailable for this fork (created before comparison tracking existed).`\n}\n\nfunction forkParentOrThrow(workspace: string): string {\n\tconst parent = getForkParentWorkspaceId(workspace)\n\tif (!parent) {\n\t\tthrow new Error(\n\t\t\t`Workspace \"${workspace}\" is not a fork — it has no parent workspace to compare against. Use diff without 'against' to compare drafts vs deployed versions.`\n\t\t)\n\t}\n\treturn parent\n}\n\nfunction forkEntryLabel(e: ForkDiffEntryView): string {\n\tconst label = e.type === 'trigger' ? `${e.triggerKind} trigger` : (e.type ?? e.kind)\n\treturn `${label} \"${e.path}\"`\n}\n\nfunction formatForkIndexEntry(e: ForkDiffEntryView): string {\n\tconst name = forkEntryLabel(e)\n\tconst draftFlag = e.hasLocalDraft ? ' [+ local draft]' : ''\n\tconst aheadBehind = [\n\t\te.ahead > 0 ? `ahead ${e.ahead}` : undefined,\n\t\te.behind > 0 ? `behind ${e.behind}` : undefined\n\t]","sourceCodeStart":6816,"sourceCodeEnd":6852,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/global/core.ts#L6816-L6852","documentation":"The copilot diff tool's `against: 'parent'` mode compares a fork's deployed items against its parent workspace. `forkParentOrThrow` resolves the fork's parent id; if the workspace has none (it is not a fork), the tool throws this error explaining that `against` is fork-only and draft-vs-deployed diffing is the alternative. It is a mode-eligibility guard.","triggerScenarios":"Calling diff with `against: 'parent'` from a workspace that is not a fork (a normal top-level workspace), so `getForkParentWorkspaceId` returns falsy.","commonSituations":"Agents assuming every workspace has a parent; users trying to compare two arbitrary workspaces via `against`; running the fork-comparison flow in the original workspace instead of the fork.","solutions":["Drop the `against` argument to compare drafts vs deployed versions in the current workspace","Switch to the actual fork workspace before using `against: 'parent'`","To compare arbitrary workspaces, use the workspace UI/CLI rather than this tool"],"exampleFix":"// before\ndiff({ type: 'script', path: 'f/build', against: 'parent' }) // not a fork\n// after\ndiff({ type: 'script', path: 'f/build' }) // draft vs deployed","handlingStrategy":"validation","validationCode":"const parent = getForkParentWorkspaceId(workspace)\nif (!parent) throw new Error(`${workspace} is not a fork; use diff without 'against'`","typeGuard":"function isFork(workspace: string): boolean {\n  return getForkParentWorkspaceId(workspace) != null\n}","tryCatchPattern":"try {\n  return await diffItem({ type, path, against: 'parent' })\n} catch (e) {\n  if (String(e?.message).includes('is not a fork')) {\n    return await diffItem({ type, path }) // fall back to draft vs deployed\n  }\n  throw e\n}","preventionTips":["Check the workspace is a fork before using against: 'parent'","Only use the parent-comparison mode inside fork workspaces","For non-fork workspaces, diff drafts vs deployed instead"],"tags":["forks","arguments","validation"],"backgroundTag":"invalid-tool-arguments","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"}