{"record":{"id":"fc869d655c92e659","repo":"deepseek-ai/deepseek-harness","slug":"workflow-run-was-cancelled-result-error","errorCode":null,"errorMessage":"workflow run was cancelled (${result.error})","messagePattern":"workflow run was cancelled \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-workflow/src/index.ts","lineNumber":309,"sourceCode":"      const recordsRun = exec.parent === undefined\n      // The shipped worker-thread engine publishes member events from later\n      // worker messages, after start() returns and this run record is active.\n      if (recordsRun) recorder.start(parent.session, run)\n\n      // Bridge the tool's abort signal to the run: if the parent step is aborted while the\n      // script is in flight, cancel the whole run. The signal also enters the engine directly, but\n      // this local bridge preserves the tool contract even if an implementation ignores it.\n      const onAbort = (): void => { run.cancel('parent step aborted') }\n      exec.signal.addEventListener('abort', onAbort, { once: true })\n\n      let result: WorkflowResult | undefined\n      try {\n        result = await run.result\n        const error = stopReasonError(result)\n        if (error !== undefined) {\n          // Map a non-clean finish to an isError result (the registry turns a\n          // throw into an isError). Report the reason, not partial output.\n          throw new Error(error)\n        }\n        return {\n          runId: run.id,\n          agentsStarted: result.agentsStarted,\n          result: result.value as JsonValue,\n        }\n      } finally {\n        exec.signal.removeEventListener('abort', onAbort)\n        try {\n          // Keep member listeners alive through disposal: an engine may\n          // synthesize cancelled member endings while reaching quiescence.\n          await run.dispose()\n          if (recordsRun) {\n            /* v8 ignore next -- WorkflowRun.result never rejects by contract, so result is assigned before finally. */\n            if (result === undefined) throw new Error('workflow run settled without a result')\n            recorder.finish(run.id, result.stopReason)\n          }\n        } finally {","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-workflow/src/index.ts#L291-L327","documentation":"Error \"workflow run was cancelled (${result.error})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/tool-workflow/src/index.ts:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the workflow without aborting it; if cancellation was unintended, check the abort-signal source."],"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"}