{"record":{"id":"58732b601a5fba90","repo":"paperclipai/paperclip","slug":"this-issue-is-linked-to-a-closed-workspace-that-ca","errorCode":null,"errorMessage":"This issue is linked to a closed workspace that cannot be reopened.","messagePattern":"This issue is linked to a closed workspace that cannot be reopened\\.","errorType":"http","errorClass":null,"httpStatus":409,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":5627,"sourceCode":"    if (!issue.assigneeAgentId) return null;\n    const rows = await executor\n      .select()\n      .from(agentWakeupRequests)\n      .where(and(\n        eq(agentWakeupRequests.companyId, issue.companyId),\n        eq(agentWakeupRequests.agentId, issue.assigneeAgentId),\n        inArray(agentWakeupRequests.status, [\"deferred_issue_execution\", \"queued\"]),\n      ))\n      .orderBy(asc(agentWakeupRequests.requestedAt));\n\n    for (const wake of rows) {\n      if (\n        readObject(wake.payload).issueId !== issue.id\n        || queuedCommentIdsFromWakePayload(wake.payload).length === 0\n      ) continue;\n      if (wake.status === \"deferred_issue_execution\") {\n        return { wake, state: \"deferred\", queueRun: null };\n      }\n      if (!wake.runId) continue;\n      const queueRun = await executor\n        .select()\n        .from(heartbeatRuns)\n        .where(and(\n          eq(heartbeatRuns.id, wake.runId),\n          eq(heartbeatRuns.companyId, issue.companyId),\n          eq(heartbeatRuns.agentId, issue.assigneeAgentId),\n          eq(heartbeatRuns.wakeupRequestId, wake.id),\n          eq(heartbeatRuns.status, \"queued\"),\n        ))\n        .limit(1)\n        .then((runRows) => runRows[0] ?? null);\n      if (queueRun) return { wake, state: \"queued\", queueRun };\n    }\n    return null;\n  }\n","sourceCodeStart":5609,"sourceCodeEnd":5645,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L5609-L5645","documentation":"reopenClosedIssueExecutionWorkspaceOrRespond could not reopen the issue's closed workspace because the linked workspace is in a state that cannot transition back to open (e.g. destroyed or non-reopenable lifecycle state).","triggerScenarios":"Thrown at server/src/routes/issues.ts:5350 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an authorization rule, not a bug: perform the action with an actor that satisfies the stated constraint (board user, the owning agent, or an in-scope resource).","If access should be allowed, verify the actor's credentials/company scope and the resource's ownership before retrying."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}