BloopAI/vibe-kanban · error · Error

Action "${action.id}" requires both workspace and repository

Error message

Action "${action.id}" requires both workspace and repository

What it means

For actions with requiresTarget === ActionTargetType.GIT, executeAction requires BOTH a workspaceId and a repoIdOrProjectId; if either is missing it throws 'Action "<id>" requires both workspace and repository'. Git actions operate on a repository inside a workspace, so both identifiers are mandatory.

Source

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

    ): 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;

          case ActionTargetType.ISSUE:
            if (!repoIdOrProjectId || !issueIds || issueIds.length === 0) {
              throw new Error(
                `Action "${action.id}" requires project and issue selection`
              );
            }
            await action.execute(executorContext, repoIdOrProjectId, issueIds);
            break;

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Ensure the action is only offered from the workspace's repository view where both workspace and repo are known.
  2. Pass both workspaceId and repoIdOrProjectId explicitly to executeAction.
  3. Gate the action handler: verify both identifiers exist before dispatching, otherwise show a selection prompt.

Example fix

// before
executeAction(action);
// after
if (!currentWorkspaceId || !repoIdOrProjectId) return;
executeAction(action, currentWorkspaceId, repoIdOrProjectId);
Defensive patterns

Strategy: validation

Validate before calling

if (action.requiresTarget === ActionTargetType.GIT && (!workspaceId || !repoIdOrProjectId)) {
  return; // both workspace and repo must be selected
}
executeAction(action, workspaceId, repoIdOrProjectId);

Try / catch

try {
  await executeAction(action, workspaceId, repoIdOrProjectId);
} catch (err) {
  if (err instanceof Error && err.message.includes('requires both workspace and repository')) {
    promptUserToSelectRepository();
  }
}

Prevention

When it happens

Trigger: Calling executeAction for a GIT action when workspaceId is undefined (no active workspace) or repoIdOrProjectId is undefined (no repository/project selected in the workspace view).

Common situations: Running git actions (branch, commit, PR creation) from a context menu whose repo selection hasn't loaded yet; triggering from outside the workspace repository view; clearing repo selection then firing the action via shortcut.

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/2528e4acae74e21f. Report an issue: GitHub.