{"record":{"id":"a4742cdd436a7736","repo":"paperclipai/paperclip","slug":"this-retry-could-not-start-open-the-task-to-review-its","errorCode":null,"errorMessage":"This retry could not start. Open the task to review its current access and recovery state.","messagePattern":"This retry could not start\\. Open the task to review its current access and recovery state\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/api/agents.ts","lineNumber":265,"sourceCode":"    companyId?: string,\n  ) => api.post<AgentWakeupResponse>(agentPath(id, companyId, \"/wakeup\"), data),\n  retryFailedRun: async (\n    id: string,\n    failedRunId: string,\n    companyId: string,\n  ) => {\n    const result = await api.post<\n      AgentWakeupResponse | ChatFailedRunRetryResponse\n    >(agentPath(id, companyId, \"/wakeup\"), {\n      source: \"on_demand\",\n      triggerDetail: \"manual\",\n      reason: \"retry_failed_run\",\n      failedRunId,\n    });\n    if (\"id\" in result) return { runId: result.id, issueId: null };\n    if (\"actionId\" in result) {\n      if (result.status === \"failed\" || result.status === \"cancelled\") {\n        throw new Error(\n          \"This retry could not start. Open the task to review its current access and recovery state.\",\n        );\n      }\n      return { runId: result.runId, issueId: result.issueId };\n    }\n    throw new Error(result.message ?? \"Retry was skipped.\");\n  },\n  loginWithClaude: (id: string, companyId?: string) =>\n    api.post<ClaudeLoginResult>(agentPath(id, companyId, \"/claude-login\"), {}),\n  startAdapterAuthLogin: (\n    companyId: string,\n    type: string,\n    data: { environmentId: string; ttlSeconds?: number; aiConnection?: import(\"@paperclipai/shared\").AiConnectionLoginIntent },\n  ) =>\n    api.post<AdapterAuthSessionResponse>(\n      `/companies/${encodeURIComponent(companyId)}/adapters/${encodeURIComponent(type)}/login-sessions`,\n      data,\n    ),","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/ui/src/api/agents.ts#L247-L283","documentation":"The UI retryFailedRun helper calls POST /agents retry with reason \"retry_failed_run\". The retry API returns either a direct run ({id}) or an action request; when the action request resolves with status \"failed\" or \"cancelled\", the client throws this message telling the user the retry never started and to open the task for recovery state.","triggerScenarios":"POST {agentPath}/retry with {reason:\"retry_failed_run\", failedRunId} returns an actionId whose final status is \"failed\" or \"cancelled\" — the server refused or aborted the retry (e.g. agent lacks access, run not retryable, approval denied).","commonSituations":"Retrying a run whose agent connection/credential was revoked; retrying while another run is active on the issue; retrying after the recovery window closed; user lacks permission to re-dispatch the agent.","solutions":["Open the issue/task in the board and check the failed run's current access and recovery state as the message advises.","Inspect the action request payload returned by the retry API for the failure/cancellation reason.","Re-authenticate or restore the agent's connection access, then retry.","Ensure no other run is active on the issue before retrying the failed run."],"exampleFix":"// before\nawait agentsApi.retryFailedRun(agentId, { reason: \"retry_failed_run\", failedRunId });\n// after\ntry {\n  await agentsApi.retryFailedRun(agentId, { reason: \"retry_failed_run\", failedRunId });\n} catch (e) {\n  navigate(`/issues/${issueId}`); // review access/recovery state in the board\n  throw e;\n}","handlingStrategy":"type-guard","validationCode":"const run = await getFailedRun(agentId, failedRunId);\nif (run.status !== \"failed\" || !run.retryable) throw new Error(\"run is not retryable; review access state first\");","typeGuard":"function isRetryStartFailure(result: unknown): result is { actionId: string; status: \"failed\" | \"cancelled\" } {\n  return typeof result === \"object\" && result !== null && \"actionId\" in result\n    && ((result as any).status === \"failed\" || (result as any).status === \"cancelled\");\n}","tryCatchPattern":"try {\n  return await agentsApi.retryFailedRun(agentId, { reason: \"retry_failed_run\", failedRunId });\n} catch (e) {\n  toast.error(e.message, { action: { label: \"Open task\", onClick: () => navigate(`/issues/${issueId}`) } });\n  return null;\n}","preventionTips":["Check the run's retryability and the agent's access state in the board before calling retry.","Ensure no other run is active on the issue before retrying.","Keep agent credentials/connections valid so recovery actions are not cancelled for access reasons."],"tags":["ui","retry","action-request"],"backgroundTag":"invalid-state-transition","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}