{"record":{"id":"a55b50e59067d86f","repo":"paperclipai/paperclip","slug":"action-issue-closed","errorCode":"action_issue_closed","errorMessage":"The issue for this tool action is closed; the approval has expired","messagePattern":"The issue for this tool action is closed; the approval has expired","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":4278,"sourceCode":"        mcpMethod: \"tools/call\",\n        requestId,\n        upstreamToolName: entry.toolName,\n        dispatched: true,\n      },\n    };\n    const controller = new AbortController();\n    const timer = setTimeout(() => controller.abort(), ms);\n    timer.unref?.();\n    try {\n      const dispatchRemote = (target: string, init: RequestInit) => options.remoteHttpRequest\n        ? options.remoteHttpRequest(target, init)\n        : guardedRemoteHttpFetch(target, init, {\n            ...remoteHttpFetchOptions(),\n            // This call site owns a caller-set budget that can exceed the\n            // transport's default response deadline, so hand it down rather than\n            // letting the tighter default cut a legitimately slow tool short.\n            responseTimeoutMs: ms,\n          });\n      let requestHeaders = headers;\n      if (connection.config.mcpSessionRequired === true) {\n        requestHeaders = await initializeMcpHttpSession({\n          send: (init) => dispatchRemote(endpoint, {\n            ...init,\n            redirect: \"manual\",\n            signal: controller.signal,\n          }),\n          headers,\n          requestId,\n        });\n      }\n      // The guard runs inside this call and the connection is pinned to the\n      // address it approved, so an operator-supplied hostname cannot be rebound\n      // onto a loopback or metadata address between validation and dispatch\n      // (PAP-17098).\n      const requestInit: RequestInit = {\n        method: \"POST\",","sourceCodeStart":4260,"sourceCodeEnd":4296,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L4260-L4296","documentation":"Post-claim recheck in approved-action execution: the issue tied to the invocation is done or cancelled (or missing), so the claimed approval is expired and marked as such. This closes the race where a claim committed just before terminal-issue expiry revocation, ensuring governed side effects never run for closed issues.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:4137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The issue was closed, expiring the approval. Reopen/use another issue and request a new approval."],"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-14T05:17:10.506Z"}