{"record":{"id":"1f980646cd73fe0f","repo":"deepseek-ai/deepseek-harness","slug":"unknown","errorCode":"UNKNOWN","errorMessage":"errorChain(error)","messagePattern":"errorChain\\(error\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/agent-loop/src/agent.ts","lineNumber":313,"sourceCode":"        if (turnEnds && this.inbox.nextStep.length === 0) {\n          await this.dispatch.serial('agent/turn-stopping', { turn, signal })\n          signal.throwIfAborted()\n        }\n        if (turnEnds && this.inbox.nextStep.length === 0) break\n        target = 'next-step'\n      }\n    } catch (error: unknown) {\n      if (signal.aborted) {\n        turnEnds = { kind: 'aborted', reason: signal.reason as AgentCancelCause }\n        throw error\n      }\n      // Every failure is structured: an `LlmError` keeps its facts, anything\n      // else flattens to `errorChain` text under the `UNKNOWN` code.\n      turnEnds = {\n        kind: 'error',\n        error: error instanceof LlmError\n          ? error.failure\n          : { message: errorChain(error), code: 'UNKNOWN' },\n      }\n      this.throwError(error)\n    } finally {\n      try {\n        // oxlint-disable-next-line typescript/no-non-null-assertion -- every exit assigns a turn ending\n        this.session.append('turn/end', { turn, reason: turnEnds! })\n      } catch (error: unknown) {\n        this.throwError(error)\n      }\n    }\n    if (!this.inbox.hasPending) return false\n    phase.abort = new AbortController()\n    // A fresh controller makes a latch set on the old one stale: the live driver claims the queue itself.\n    phase.wakeRequested = false\n    phase.step = 0\n    return true\n  }\n","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent-loop/src/agent.ts#L295-L331","documentation":"Error \"errorChain(error)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent-loop/src/agent.ts:313 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error chain in the surrounding log context; this message forwards the chain of an underlying failure, so fix the root cause it names."],"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"}