{"record":{"id":"253e6915880c4859","repo":"deepseek-ai/deepseek-harness","slug":"aborted-253e69","errorCode":"ABORTED","errorMessage":"pi-ai stream aborted","messagePattern":"pi-ai stream aborted","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/llm/llm-pi-ai/src/stream.ts","lineNumber":109,"sourceCode":"  switch (message.stopReason) {\n    case 'stop':\n      // A terminal stop that produced no content blocks is a degenerate\n      // provider completion, not a successful (empty) assistant message.\n      if (message.content.length === 0) {\n        return {\n          kind: 'error',\n          failure: {\n            message: `model \"${message.model}\" returned a completed response with no content`,\n            code: EMPTY_RESPONSE_CODE,\n          },\n        }\n      }\n      return { kind: 'stop' }\n    case 'length': return { kind: 'max-tokens' }\n    case 'toolUse': return { kind: 'tool-calls' }\n    case 'aborted': return {\n      kind: 'aborted',\n      failure: { message: message.errorMessage ?? 'pi-ai stream aborted', code: 'ABORTED' },\n    }\n    case 'error': {\n      const text = message.errorMessage ?? 'pi-ai stream error'\n      return { kind: 'error', failure: { message: text, code: classifyPiAiError(text) } }\n    }\n  }\n}\n\n/**\n * Translate the pi-ai event stream into StreamChunks. pi-ai never throws\n * mid-stream — failures arrive as `error` events, which become error/aborted\n * `finish` chunks (the harness protocol's other error-delivery style).\n * @param events - one assistant turn's pi-ai event stream.\n * @param contextWindow - resolved catalog capacity for usage-based overflow detection.\n * @returns the harness chunks, ending with `usage` then `finish`; throws\n *   `LlmError` (`STREAM_CLOSED`) if the source ends without a terminal event.\n */\nexport async function* toStreamChunks(","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm-pi-ai/src/stream.ts#L91-L127","documentation":"Error \"pi-ai stream aborted\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm-pi-ai/src/stream.ts:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; if the abort was unintended, check what triggered the abort signal (timeout, cancellation, connection loss) in the caller."],"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"}