{"record":{"id":"30ef17393b7b3182","repo":"deepseek-ai/deepseek-harness","slug":"subject-message-must-have-model-source","errorCode":null,"errorMessage":"${subject} message must have model source","messagePattern":"(.+?) message must have model source","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/index.ts","lineNumber":332,"sourceCode":"  }\n  const messageRecord = message as Record<string, unknown>\n  const expectedRole = type === 'assistant/message' ? 'assistant' : 'user'\n  if (messageRecord['role'] !== expectedRole) {\n    throw new Error(`${subject} message must have role \"${expectedRole}\"`)\n  }\n  const source = messageRecord['source']\n  if (typeof source !== 'object' || source === null\n    || typeof (source as Record<string, unknown>)['kind'] !== 'string'\n    || (source as Record<string, unknown>)['kind'] === '') {\n    throw new Error(`${subject} message has invalid source`)\n  }\n  if (!Array.isArray(messageRecord['content'])) {\n    throw new Error(`${subject} message has invalid content`)\n  }\n  const sourceRecord = source as Record<string, unknown>\n  if (type === 'assistant/message') {\n    if (sourceRecord['kind'] !== 'model' || !hasProviderModel(sourceRecord)) {\n      throw new Error(`${subject} message must have model source`)\n    }\n    return\n  }\n  if (type !== 'tool/result') return\n  if (sourceRecord['kind'] !== 'tool'\n    || typeof sourceRecord['callId'] !== 'string'\n    || sourceRecord['callId'] === '') {\n    throw new Error(`${subject} message must have tool source`)\n  }\n  const content = messageRecord['content'] as unknown[]\n  const block = content[0]\n  if (content.length !== 1 || typeof block !== 'object' || block === null\n    || (block as Record<string, unknown>)['type'] !== 'tool-result'\n    || !Array.isArray((block as Record<string, unknown>)['content'])) {\n    throw new Error(`${subject} message must contain one tool-result block`)\n  }\n  if ((block as Record<string, unknown>)['toolCallId'] !== sourceRecord['callId']) {\n    throw new Error(`${subject} message has mismatched tool call ids`)","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/index.ts#L314-L350","documentation":"Error \"${subject} message must have model source\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/session/src/index.ts:332 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use model as the source of the subject message."],"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"}