{"record":{"id":"40ec797e353b09d7","repo":"deepseek-ai/deepseek-harness","slug":"session-event-carried-no-event-envelope-json-st","errorCode":null,"errorMessage":"session.event carried no event envelope: ${JSON.stringify(value)}","messagePattern":"session\\.event carried no event envelope: (.+?)","errorType":"exception","errorClass":"SdkProtocolError","httpStatus":null,"severity":"error","filePath":"packages/sdk/client/src/api.ts","lineNumber":209,"sourceCode":"      events,\n      notifications,\n    }\n  }\n}\n\n/**\n * Normalize run input: a string becomes one text block; blocks pass verbatim.\n * @param input - prompt text or content blocks.\n * @returns the content blocks to send.\n */\nexport function normalizeInput(input: string | ContentBlock[]): ContentBlock[] {\n  return typeof input === 'string' ? [{ type: 'text', text: input }] : input\n}\n\n/** Validate the fields in a wire `session.event` envelope before returning the typed result. */\nfunction validatedSessionEvent(value: unknown): SessionEvent {\n  if (!isRecord(value) || typeof value.type !== 'string') {\n    throw new SdkProtocolError(`session.event carried no event envelope: ${JSON.stringify(value)}`)\n  }\n  // The one variant this module reads into (finalResponse) must carry\n  // kind-tagged content blocks; other variants pass through under their\n  // envelope shape.\n  if (value.type === 'assistant/message') {\n    const message = isRecord(value.data) ? value.data.message : undefined\n    const content = isRecord(message) ? message.content : undefined\n    if (!Array.isArray(content) || !content.every(block => isRecord(block) && typeof block.type === 'string')) {\n      throw new SdkProtocolError(`assistant/message event carried malformed content: ${JSON.stringify(value)}`)\n    }\n  }\n  return value as unknown as SessionEvent\n}\n\n/** Whether a raw session event is the durable enqueue receipt for `messageId`. */\nfunction isInboxReceipt(value: unknown, messageId: string): boolean {\n  if (!isRecord(value) || value.type !== 'agent/inbox/spliced' || !isRecord(value.data)) return false\n  const inserted = value.data.inserted","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/sdk/client/src/api.ts#L191-L227","documentation":"Error \"session.event carried no event envelope: ${JSON.stringify(value)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/sdk/client/src/api.ts:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade the server: it must send session.event envelopes matching the SDK protocol version.","Reconnect with a compatible SDK/server pair."],"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"}