BloopAI/vibe-kanban · error · Error

Action "${action.id}" requires a workspace target

Error message

Action "${action.id}" requires a workspace target

What it means

ActionsProvider.executeAction dispatches based on `action.requiresTarget`. When the action declares ActionTargetType.WORKSPACE, a workspaceId must be supplied by the caller; if it is missing, the provider throws 'Action "<id>" requires a workspace target'. The error is caught and surfaced to the user through a destructive ConfirmDialog.

Source

Thrown at packages/web-core/src/shared/providers/ActionsProvider.tsx:281

  ]);

  // Main action executor with centralized target validation and error handling
  const executeAction = useCallback(
    async (
      action: ActionDefinition,
      workspaceId?: string,
      repoIdOrProjectId?: string,
      issueIds?: string[]
    ): Promise<void> => {
      try {
        switch (action.requiresTarget) {
          case ActionTargetType.NONE:
            await action.execute(executorContext);
            break;

          case ActionTargetType.WORKSPACE:
            if (!workspaceId) {
              throw new Error(
                `Action "${action.id}" requires a workspace target`
              );
            }
            await action.execute(executorContext, workspaceId);
            break;

          case ActionTargetType.GIT:
            if (!workspaceId || !repoIdOrProjectId) {
              throw new Error(
                `Action "${action.id}" requires both workspace and repository`
              );
            }
            await action.execute(
              executorContext,
              workspaceId,
              repoIdOrProjectId
            );
            break;

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Only render/enable WORKSPACE-target actions when a workspace is active (check the selection context before showing the menu item).
  2. Pass the current workspaceId explicitly when calling executeAction.
  3. If invoking programmatically, pre-check `workspaceId` and no-op or show a 'select a workspace' prompt instead.

Example fix

// before
executeAction(action);
// after
if (!currentWorkspaceId) return; // or prompt user to open a workspace
executeAction(action, currentWorkspaceId);
Defensive patterns

Strategy: validation

Validate before calling

if (action.requiresTarget === ActionTargetType.WORKSPACE && !workspaceId) {
  return; // or prompt the user to open a workspace first
}
executeAction(action, workspaceId);

Try / catch

try {
  await executeAction(action, workspaceId);
} catch (err) {
  if (err instanceof Error && err.message.includes('requires a workspace target')) {
    promptUserToSelectWorkspace();
  }
}

Prevention

When it happens

Trigger: Invoking executeAction(action) (or a context/menu handler wired to it) for an action whose requiresTarget is WORKSPACE while no workspace is selected/active — workspaceId is undefined because nothing is open or the selection was cleared.

Common situations: Triggering a workspace-scoped action from a global command palette or keyboard shortcut with no workspace open; invoking an action from a project-level view where the workspace context is not propagated; stale UI after a workspace was closed.

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 BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/0a3564c6f7bf6352. Report an issue: GitHub.