{"record":{"id":"9c35f107d45e2014","repo":"deepseek-ai/deepseek-harness","slug":"subagent-activation-childid-activation-teardo","errorCode":null,"errorMessage":"subagent \"${activation.childId}\" activation teardown failed: ${errorChain(error)}","messagePattern":"subagent \"(.+?)\" activation teardown failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/subagent/subagent/src/continuation.ts","lineNumber":1323,"sourceCode":"        // resident handle that this watcher is already about to tear down.\n        const settling = await this.locks.run<SettlementAttempt>(activation.childId, () => {\n          if (disposalOf(activation) !== undefined || this.stateOf(activation) !== 'settled') {\n            return Promise.resolve({ settling: false })\n          }\n          // `dispose()` assigns its memoized transaction synchronously, so\n          // admission is closed before this critical section releases.\n          return Promise.resolve({ settling: true, done: this.dispose(activation) })\n        })\n        if (!settling.settling) {\n          // Still running, or waiting on descendants: re-observe after the next\n          // accepted message or ownership release.\n          if (activation.handle.agent.status !== 'running') await poked\n          continue\n        }\n        try {\n          await settling.done\n        } catch (error: unknown) {\n          this.ctx.logger.warn(\n            `subagent \"${activation.childId}\" activation teardown failed: ${errorChain(error)}`,\n          )\n        }\n        return\n      }\n    })()\n  }\n\n  /**\n   * Stop one Activation immediately, then release it child-first. The memoized\n   * transaction is installed before cancellation or recursive callbacks, so\n   * admission and reentrant teardown converge on the same owner.\n   *\n   * The final session flush is best effort and never prevents handle disposal\n   * or ownership release, because retaining a child would permanently pin its\n   * ancestors in `waiting`.\n   * @param activation - the residency epoch to stop and release.\n   * @returns the one disposal transaction owned by this Activation.","sourceCodeStart":1305,"sourceCodeEnd":1341,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subagent/subagent/src/continuation.ts#L1305-L1341","documentation":"Error \"subagent \"${activation.childId}\" activation teardown failed: ${errorChain(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subagent/subagent/src/continuation.ts:1323 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Manually dispose the leaked child activation resources and investigate the teardown error chain before reusing the child id."],"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"}