{"record":{"id":"3a95eecf26646032","repo":"deepseek-ai/deepseek-harness","slug":"acp-continuable-subagent-teardown-failed-strin","errorCode":null,"errorMessage":"acp: continuable subagent teardown failed: ${String(error)}","messagePattern":"acp: continuable subagent teardown failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/acp/acp/src/index.ts","lineNumber":490,"sourceCode":"      // available. session/event enqueues output synchronously before idle.\n      await Promise.all(records.map(async (record) => {\n        await record.inflight?.admissionDone\n        await record.agent.whenIdle()\n        await record.outputTail\n      }))\n      // Continuable subagents outlive the turn that started them, and their\n      // Activations own descendant teardown. Drain only these sessions' forests\n      // child-first BEFORE disposing the top-level agents, so no descendant is\n      // left holding a runtime its owner already released and another frontend\n      // sharing this Context remains live.\n      // Read the one teardown method structurally: the bridge needs no other\n      // part of the subagent seam, so it does not depend on that package.\n      const subagents = ctx.get('subagents') as ContinuableDrain | undefined\n      if (subagents !== undefined) {\n        try {\n          await subagents.drainContinuableDescendants(records.map(record => record.agent))\n        } catch (error: unknown) {\n          logger.warn(`acp: continuable subagent teardown failed: ${String(error)}`)\n        }\n      }\n      const disposals = await Promise.allSettled(records.map(record => record.dispose()))\n      const failures: unknown[] = []\n      for (const result of disposals) {\n        if (result.status === 'rejected') failures.push(result.reason as unknown)\n      }\n      if (failures.length > 0) {\n        // The production consumer logs this AggregateError through `String`,\n        // which renders only its message. Embed every per-session diagnostic,\n        // including nested causes and aggregate members, in that message.\n        const detail = failures.map(failure => errorChain(failure)).join('; ')\n        throw new AggregateError(\n          failures,\n          `ACP agent teardown failed for ${failures.length} session(s): ${detail}`,\n        )\n      }\n    })()","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/acp/acp/src/index.ts#L472-L508","documentation":"Error \"acp: continuable subagent teardown failed: ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/acp/acp/src/index.ts:490 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the teardown error; the failure is logged and teardown continues, but fix the underlying resource release issue."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}