windmill-labs/windmill · error

path is required.

Error message

path is required.

What it means

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.

Source

Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6971

	return result
}

// One item's fork-vs-parent unified diff (deployed sides only).
async function diffForkItem(
	args: {
		type?: WorkspaceItemType
		path?: string
		trigger_kind?: TriggerKind
		file?: string
		offset?: number
		limit?: number
	},
	ctx: WriteDraftCtx
): Promise<string> {
	const { workspace, toolId, toolCallbacks } = ctx
	const { type, path, trigger_kind: triggerKind } = args
	if (!path) {
		throw new Error('path is required.')
	}
	const parent = forkParentOrThrow(workspace)
	// No type = path-only wildcard: comparison kinds outside the chat type enum
	// (folder, resource_type, …) are only reachable this way.
	const kinds = type ? forkKindsFor(type, triggerKind) : []
	if (type === 'trigger' && kinds.length === 0) {
		throw new Error('trigger_kind is required when type is trigger.')
	}
	toolCallbacks.setToolStatus(toolId, {
		content: `Comparing fork vs parent for "${path}"...`
	})
	if ((await getForkComparisonStatus(workspace, parent)).skippedComparison) {
		const message = forkComparisonUnavailableMessage(parent)
		toolCallbacks.setToolStatus(toolId, { content: message })
		return message
	}
	const entries = await readForkDiffEntries(workspace, parent, kinds, path)
	if (entries.length === 0) {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Retry including the item's exact path
  2. If you want everything, use the workspace-wide fork comparison instead of the single-item tool

Example fix

// before
diffFork({ type: 'script' })
// after
diffFork({ type: 'script', path: 'f/build' })
Defensive patterns

Strategy: validation

Validate before calling

if (!args.path || args.path.trim() === '') {
  throw new Error('path is required for fork comparison')
}

Type guard

function hasPath(args: { path?: string }): args is { path: string } {
  return typeof args.path === 'string' && args.path.length > 0
}

Try / catch

try {
  return await diffFork(args)
} catch (e) {
  if (String(e?.message) === 'path is required.') {
    // prompt the caller/agent for the item path and retry
    return requestMissingArgument('path')
  }
  throw e
}

Prevention

When it happens

Trigger: 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`.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/cd6a833e30ad638e. Report an issue: GitHub.