{"record":{"id":"5973d0ddc954e9c2","repo":"paperclipai/paperclip","slug":"approval-path-missing","errorCode":"approval_path_missing","errorMessage":"Tool action requires approval, but this gateway session is not attached to an issue","messagePattern":"Tool action requires approval, but this gateway session is not attached to an issue","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":1567,"sourceCode":"      reasonCode: input.reasonCode ?? null,\n      matchedPolicyIds: [],\n      requestHash: input.argumentsSummary?.sha256 ?? null,\n      requestSummary: input.argumentsSummary ?? null,\n      resultHash: input.resultSummary?.sha256 ?? null,\n      resultSummary: input.resultSummary ?? null,\n      resultSizeBytes: input.resultSummary?.sizeBytes ?? null,\n      metadata: Object.keys(metadata).length > 0 || input.metadata || input.session.projectId || input.session.identityContextId\n        ? {\n            ...metadata,\n            identityContextId: input.session.identityContextId ?? null,\n            gatewayId: input.session.gatewayId ?? null,\n            gatewayName: input.session.gatewayName ?? null,\n            projectId: input.session.projectId ?? null,\n            ...(input.metadata ?? {}),\n          }\n        : null,\n    });\n  }\n\n  async function reflectToolActionInteractionLifecycle(input: {\n    actionRequestId: string;\n    status: \"approved\" | \"executing\" | \"executed\" | \"failed\" | \"expired\" | \"cancelled\";\n    errorCode?: string | null;\n    errorMessage?: string | null;\n    resultSummary?: string | null;\n  }): Promise<void> {\n    const [linked] = await db\n      .select({\n        companyId: toolActionRequests.companyId,\n        interactionId: toolActionRequests.interactionId,\n        issueId: toolActionRequests.issueId,\n      })\n      .from(toolActionRequests)\n      .where(eq(toolActionRequests.id, input.actionRequestId))\n      .limit(1);\n    if (!linked?.interactionId) return;","sourceCodeStart":1549,"sourceCodeEnd":1585,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L1549-L1585","documentation":"An approval-required tool call arrived over a gateway session with no issueId attached, so there is no task thread to post the approval card on. The invocation is marked denied (approval_path_missing), a call_denied event is written, and the agent is told to re-run the action from a run that has the task checked out.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:1533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Attach the gateway session to an issue (issue-scoped session) so approval requests can be routed, or use a tool that does not require 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"}