paperclipai/paperclip · error · Error

Issue has no current execution workspace

Error message

Issue has no current execution workspace

What it means

The paperclipControlIssueWorkspaceServices tool first fetches the issue's workspace runtime via getIssueWorkspaceRuntime and then requires runtime.workspace?.id to be a string before issuing the control POST. If the issue has no current execution workspace (id missing or non-string), it throws before calling the API.

Source

Thrown at packages/mcp-server/src/tools.ts:374

        const qs = companyId ? `?companyId=${encodeURIComponent(companyId)}` : "";
        return client.requestJson("GET", `/projects/${encodeURIComponent(projectId)}${qs}`);
      },
    ),
    makeTool(
      "paperclipGetIssueWorkspaceRuntime",
      "Get the current execution workspace and runtime services for an issue, including service URLs",
      z.object({ issueId: issueIdSchema }),
      async ({ issueId }) => getIssueWorkspaceRuntime(client, issueId),
    ),
    makeTool(
      "paperclipControlIssueWorkspaceServices",
      "Start, stop, or restart the current issue execution workspace runtime services",
      issueWorkspaceRuntimeControlSchema,
      async ({ issueId, action, ...target }) => {
        const runtime = await getIssueWorkspaceRuntime(client, issueId);
        const workspaceId = typeof runtime.workspace?.id === "string" ? runtime.workspace.id : null;
        if (!workspaceId) {
          throw new Error("Issue has no current execution workspace");
        }
        return client.requestJson(
          "POST",
          `/execution-workspaces/${encodeURIComponent(workspaceId)}/runtime-services/${action}`,
          { body: target },
        );
      },
    ),
    makeTool(
      "paperclipWaitForIssueWorkspaceService",
      "Wait until an issue execution workspace runtime service is running and has a URL when one is exposed",
      waitForIssueWorkspaceServiceSchema,
      async ({ issueId, runtimeServiceId, serviceName, timeoutSeconds }) => {
        const deadline = Date.now() + (timeoutSeconds ?? 60) * 1000;
        let latest: Awaited<ReturnType<typeof getIssueWorkspaceRuntime>> | null = null;
        while (Date.now() <= deadline) {
          latest = await getIssueWorkspaceRuntime(client, issueId);
          const service = selectRuntimeService(latest.runtimeServices, { runtimeServiceId, serviceName });

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Call paperclipGetIssueWorkspaceRuntime and inspect the response — if workspace is null, create/start a workspace first.
  2. Ensure the issue has an active run (agent dispatched) that provisions the workspace.
  3. Wait for workspace provisioning to complete and retry.

Example fix

// before
await controlIssueWorkspaceServices({ issueId, action: 'restart' })  // -> error
// after
const rt = await getIssueWorkspaceRuntime(issueId)
if (!rt.workspace?.id) await createIssueWorkspace(issueId)
await controlIssueWorkspaceServices({ issueId, action: 'restart' })
Defensive patterns

Strategy: try-catch

Validate before calling

const rt = await getIssueWorkspaceRuntime(client, issueId);
if (typeof rt.workspace?.id !== 'string') throw new Error(`Issue ${issueId} has no workspace; create one first`);

Type guard

function hasWorkspaceId(rt: unknown): rt is { workspace: { id: string } } {
  return typeof rt === 'object' && rt !== null && typeof (rt as any).workspace?.id === 'string';
}

Try / catch

try { await controlIssueWorkspaceServices({ issueId, action }) }
catch (e) {
  if (/no current execution workspace/.test(String(e.message))) { await createIssueWorkspace(issueId); /* retry */ } else throw e;
}

Prevention

When it happens

Trigger: Invoking start/stop/restart on runtime services for an issue that has not been assigned an execution workspace yet, or whose workspace was deleted/archived so the runtime response omits workspace.id.

Common situations: Issue was never started / no run launched; workspace provisioning still in progress; workspace torn down after run completion; calling control before create-issue-workspace.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/95f9a0e7944ce62c. Report an issue: GitHub.