{"record":{"id":"cd6a833e30ad638e","repo":"windmill-labs/windmill","slug":"path-is-required","errorCode":null,"errorMessage":"path is required.","messagePattern":"path is required\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/global/core.ts","lineNumber":6971,"sourceCode":"\treturn result\n}\n\n// One item's fork-vs-parent unified diff (deployed sides only).\nasync function diffForkItem(\n\targs: {\n\t\ttype?: WorkspaceItemType\n\t\tpath?: string\n\t\ttrigger_kind?: TriggerKind\n\t\tfile?: string\n\t\toffset?: number\n\t\tlimit?: number\n\t},\n\tctx: WriteDraftCtx\n): Promise<string> {\n\tconst { workspace, toolId, toolCallbacks } = ctx\n\tconst { type, path, trigger_kind: triggerKind } = args\n\tif (!path) {\n\t\tthrow new Error('path is required.')\n\t}\n\tconst parent = forkParentOrThrow(workspace)\n\t// No type = path-only wildcard: comparison kinds outside the chat type enum\n\t// (folder, resource_type, …) are only reachable this way.\n\tconst kinds = type ? forkKindsFor(type, triggerKind) : []\n\tif (type === 'trigger' && kinds.length === 0) {\n\t\tthrow new Error('trigger_kind is required when type is trigger.')\n\t}\n\ttoolCallbacks.setToolStatus(toolId, {\n\t\tcontent: `Comparing fork vs parent for \"${path}\"...`\n\t})\n\tif ((await getForkComparisonStatus(workspace, parent)).skippedComparison) {\n\t\tconst message = forkComparisonUnavailableMessage(parent)\n\t\ttoolCallbacks.setToolStatus(toolId, { content: message })\n\t\treturn message\n\t}\n\tconst entries = await readForkDiffEntries(workspace, parent, kinds, path)\n\tif (entries.length === 0) {","sourceCodeStart":6953,"sourceCodeEnd":6989,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/global/core.ts#L6953-L6989","documentation":"The fork-comparison diff tool requires a `path`; when `args.path` is falsy (undefined, empty, or whitespace-less) it throws this minimal validation error before doing any work. The tool compares a single item between a fork and its parent, so a path is mandatory.","triggerScenarios":"Calling the fork diff tool with `path` omitted or an empty string, e.g. intending a wildcard comparison but leaving path unset while also omitting `type`.","commonSituations":"Agents constructing tool calls programmatically and dropping the path; template calls with unfilled placeholders; confusing this single-item tool with the workspace-wide fork comparison that needs no path.","solutions":["Retry including the item's exact path","If you want everything, use the workspace-wide fork comparison instead of the single-item tool"],"exampleFix":"// before\ndiffFork({ type: 'script' })\n// after\ndiffFork({ type: 'script', path: 'f/build' })","handlingStrategy":"validation","validationCode":"if (!args.path || args.path.trim() === '') {\n  throw new Error('path is required for fork comparison')\n}","typeGuard":"function hasPath(args: { path?: string }): args is { path: string } {\n  return typeof args.path === 'string' && args.path.length > 0\n}","tryCatchPattern":"try {\n  return await diffFork(args)\n} catch (e) {\n  if (String(e?.message) === 'path is required.') {\n    // prompt the caller/agent for the item path and retry\n    return requestMissingArgument('path')\n  }\n  throw e\n}","preventionTips":["Always include `path` in single-item fork diff calls","Validate tool-call arguments against the schema before sending","Use the workspace-wide fork comparison when no specific path is intended"],"tags":["arguments","validation","forks"],"backgroundTag":"missing-required-argument","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"}