deepseek-ai/deepseek-harness · error · AggregateError

ACP agent teardown failed for ${failures.length} session(s):

Error message

ACP agent teardown failed for ${failures.length} session(s): ${detail}

What it means

Error "ACP agent teardown failed for ${failures.length} session(s): ${detail}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/acp/acp/src/index.ts:503

      const subagents = ctx.get('subagents') as ContinuableDrain | undefined
      if (subagents !== undefined) {
        try {
          await subagents.drainContinuableDescendants(records.map(record => record.agent))
        } catch (error: unknown) {
          logger.warn(`acp: continuable subagent teardown failed: ${String(error)}`)
        }
      }
      const disposals = await Promise.allSettled(records.map(record => record.dispose()))
      const failures: unknown[] = []
      for (const result of disposals) {
        if (result.status === 'rejected') failures.push(result.reason as unknown)
      }
      if (failures.length > 0) {
        // The production consumer logs this AggregateError through `String`,
        // which renders only its message. Embed every per-session diagnostic,
        // including nested causes and aggregate members, in that message.
        const detail = failures.map(failure => errorChain(failure)).join('; ')
        throw new AggregateError(
          failures,
          `ACP agent teardown failed for ${failures.length} session(s): ${detail}`,
        )
      }
    })()
    return quiescing
  }

  /* v8 ignore start -- production transport rejection and teardown failure. */
  void conn.closed
    .catch((error: unknown) => {
      logger.warn(`acp: connection closed with an error: ${String(error)}`)
    })
    .then(quiesce)
    .catch((error: unknown) => {
      logger.warn(`acp: connection-close teardown failed: ${String(error)}`)
    })
  /* v8 ignore stop */

View on GitHub (pinned to b150a551b8)

Solutions

  1. Read the per-session failure detail, fix each failing session teardown, and retry closing the ACP agent.

When it happens

Trigger: Thrown at packages/acp/acp/src/index.ts:503 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/50cf02650e6ba521. Report an issue: GitHub.