{"record":{"id":"bf169f623520f249","repo":"toeverything/AFFiNE","slug":"aborted","errorCode":"ABORTED","errorMessage":"The delegated read was cancelled.","messagePattern":"The delegated read was cancelled\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/backend/server/src/plugins/copilot/delegated/service.ts","lineNumber":168,"sourceCode":"    const interrupted = new Promise<DelegatedToolResponse>(resolve => {\n      timeout = setTimeout(() => {\n        reason = 'timeout';\n        resolve({\n          ...identity,\n          error: {\n            code: 'FRONTEND_TIMEOUT',\n            message: 'The focused editor did not respond before the deadline.',\n            retryable: true,\n          },\n        });\n      }, TOOL_TIMEOUT_MS);\n      timeout.unref?.();\n      abort = () => {\n        reason = 'aborted';\n        resolve({\n          ...identity,\n          error: {\n            code: 'ABORTED',\n            message: 'The delegated read was cancelled.',\n            retryable: false,\n          },\n        });\n      };\n      if (signal?.aborted) {\n        abort();\n      } else {\n        signal?.addEventListener('abort', abort, { once: true });\n      }\n    });\n\n    const result = await Promise.race([response, interrupted]);\n    this.pending.delete(identity.requestId);\n    if (timeout) clearTimeout(timeout);\n    if (abort) signal?.removeEventListener('abort', abort);\n    if (reason) {\n      this.publisher.publish(","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/backend/server/src/plugins/copilot/delegated/service.ts#L150-L186","documentation":"The delegated read was cancelled while awaiting the editor's response (abort path sets reason='aborted'); execute() resolves the pending request with a structured ABORTED tool error instead of continuing to wait.","triggerScenarios":"Returned as ABORTED when the AbortSignal for the delegated execution fires (or was already aborted), cancelling the pending read.","commonSituations":"The user stopped the copilot run or the request was cancelled mid-flight. Restart the action if the result is still needed; it is not retried automatically.","solutions":["No action needed; the read was cancelled by the caller.","Re-issue the read if the result is still required."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}