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
- Only render/enable WORKSPACE-target actions when a workspace is active (check the selection context before showing the menu item).
- Pass the current workspaceId explicitly when calling executeAction.
- 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
- Only enable/offer WORKSPACE actions when a workspace is active
- Clear keyboard shortcuts that can fire workspace actions with no context
- Centralize action availability checks in one menu/filter helper
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
- Action "${action.id}" requires both workspace and repository
- Action "${action.id}" requires project and issue selection
- result.error
- Provide `prompt`, or `issue_id` that has a non-empty title/d
- Failed to list projects (${res.status})
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/0a3564c6f7bf6352.
Report an issue: GitHub.