{"record":{"id":"91a9351651d0014b","repo":"deepseek-ai/deepseek-harness","slug":"session-event-type-carries-non-json-serializa-91a935","errorCode":null,"errorMessage":"session event \"${type}\" carries non-JSON-serializable surface metadata","messagePattern":"session event \"(.+?)\" carries non-JSON-serializable surface metadata","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/session/src/index.ts","lineNumber":621,"sourceCode":"   */\n  append<T extends SessionEventType>(\n    type: T,\n    data: SessionEventMap[T],\n    ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []\n  ): SessionEvent<T> {\n    const surfaceOpts: SurfaceIntent | undefined = opts[0]\n    const surfaceMetadata = {\n      ...surfaceOpts?.sourceEventSeqs === undefined ? {} : { sourceEventSeqs: surfaceOpts.sourceEventSeqs },\n      ...surfaceOpts?.surfaceOp === undefined ? {} : { surfaceOp: surfaceOpts.surfaceOp },\n    }\n    const dataSnapshot = snapshotJsonValue(data)\n    if (dataSnapshot === undefined) {\n      throw new Error(`session event \"${type}\" carries non-JSON-serializable data`)\n    }\n    assertSupportedRequestHeader(type, dataSnapshot, `session event \"${type}\"`)\n    const surfaceMetadataSnapshot = snapshotJsonValue(surfaceMetadata)\n    if (surfaceMetadataSnapshot === undefined) {\n      throw new Error(`session event \"${type}\" carries non-JSON-serializable surface metadata`)\n    }\n    const entry = attachments.get(this)\n    if (entry?.appending) {\n      throw new Error('session append cannot reenter while another append is being published')\n    }\n    const event = deepFreeze({\n      type,\n      seq: this.log.length,\n      time: Date.now(),\n      data: dataSnapshot,\n      ...(surfaceMetadataSnapshot as { surfaceOp?: unknown; sourceEventSeqs?: unknown }),\n    } as unknown as SessionEvent<T>)\n    this.surfaceManager.validateNext(event as SessionEvent)\n\n    if (entry !== undefined) entry.appending = true\n    try {\n      let callbacks: SessionCallback[] | undefined\n      const callbackArgs: unknown[] = [this, event]","sourceCodeStart":603,"sourceCodeEnd":639,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/session/src/index.ts#L603-L639","documentation":"Error \"session event \"${type}\" carries non-JSON-serializable surface metadata\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/session/src/index.ts:621 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}