toeverything/AFFiNE · error

ABORTED

ABORTED

Error message

The delegated read was cancelled.

What it means

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.

Source

Thrown at packages/backend/server/src/plugins/copilot/delegated/service.ts:168

    const interrupted = new Promise<DelegatedToolResponse>(resolve => {
      timeout = setTimeout(() => {
        reason = 'timeout';
        resolve({
          ...identity,
          error: {
            code: 'FRONTEND_TIMEOUT',
            message: 'The focused editor did not respond before the deadline.',
            retryable: true,
          },
        });
      }, TOOL_TIMEOUT_MS);
      timeout.unref?.();
      abort = () => {
        reason = 'aborted';
        resolve({
          ...identity,
          error: {
            code: 'ABORTED',
            message: 'The delegated read was cancelled.',
            retryable: false,
          },
        });
      };
      if (signal?.aborted) {
        abort();
      } else {
        signal?.addEventListener('abort', abort, { once: true });
      }
    });

    const result = await Promise.race([response, interrupted]);
    this.pending.delete(identity.requestId);
    if (timeout) clearTimeout(timeout);
    if (abort) signal?.removeEventListener('abort', abort);
    if (reason) {
      this.publisher.publish(

View on GitHub (pinned to b4c8548c09)

Solutions

  1. No action needed; the read was cancelled by the caller.
  2. Re-issue the read if the result is still required.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Returned as ABORTED when the AbortSignal for the delegated execution fires (or was already aborted), cancelling the pending read.

Common situations: 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.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/bf169f623520f249. Report an issue: GitHub.