{"record":{"id":"918584d547d5d6d0","repo":"deepseek-ai/deepseek-harness","slug":"subagent-run-failed-string-execution-reason","errorCode":null,"errorMessage":"subagent run failed: ${String(execution.reason)}; dispose failed: ${String(disposal.reason)}","messagePattern":"subagent run failed: (.+?); dispose failed: (.+?)","errorType":"exception","errorClass":"AggregateError","httpStatus":null,"severity":"error","filePath":"packages/subagent/tool-subagent/src/index.ts","lineNumber":197,"sourceCode":"      const error = stopReasonError(result)\n      if (error !== undefined) {\n        // The registry converts this throw to isError; partial output is not\n        // success, but the preserved partial answer still reaches the parent.\n        throw new Error(withDiagnosticAndPartialText(error, result))\n      }\n      return {\n        kind: 'foreground',\n        runId: run.id,\n        // Content blocks already cross durable JSON boundaries elsewhere;\n        // the registry performs the authoritative lossless snapshot here.\n        output: result.output as unknown as JsonValue[],\n      }\n    }),\n  ])\n  const [disposal] = await Promise.allSettled([Promise.resolve().then(() => run.dispose())])\n  if (execution.status === 'rejected') {\n    if (disposal.status === 'rejected') {\n      throw new AggregateError(\n        [execution.reason, disposal.reason],\n        `subagent run failed: ${String(execution.reason)}; dispose failed: ${String(disposal.reason)}`,\n      )\n    }\n    throw execution.reason\n  }\n  if (disposal.status === 'rejected') throw disposal.reason\n  return execution.value\n}\n\n/**\n * Model-facing wording from the provider's conversation-history descriptor\n * ({@link SubagentProvider.inheritsParentContext}).\n * A fresh child needs a standalone prompt; a forked child already sees the\n * conversation's completed turns — telling the model to restate everything\n * (or, worse, that the child \"does not see this conversation\") would be false\n * for a fork.\n * @param inheritsConversation - whether the child's conversation is seeded","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subagent/tool-subagent/src/index.ts#L179-L215","documentation":"Error \"subagent run failed: ${String(execution.reason)}; dispose failed: ${String(disposal.reason)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subagent/tool-subagent/src/index.ts:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the primary run failure first, then investigate the dispose failure cause reported after it."],"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"}