{"record":{"id":"a79ce1db543cf3de","repo":"deepseek-ai/deepseek-harness","slug":"result-unserializable","errorCode":"RESULT_UNSERIALIZABLE","errorMessage":"the workflow's return value is not plain JSON data — ${error.message}. Return only JSON-serializable objects/arrays/scalars.","messagePattern":"the workflow's return value is not plain JSON data — (.+?)\\. Return only JSON-serializable objects/arrays/scalars\\.","errorType":"exception","errorClass":"WorkflowError","httpStatus":null,"severity":"error","filePath":"packages/workflow/workflow-worker-thread/src/runtime.ts","lineNumber":214,"sourceCode":"    promise.catch(() => { /* consumed: see method contract — a dropped hook promise must not surface an unhandled rejection */ })\n    return promise\n  }\n\n  private cancelledError(): WorkflowError {\n    // cancel() arms cancelError before any caller can observe isCancelled()\n    // === true; the fallback guards the type, not a reachable path.\n    /* v8 ignore next */\n    return this.cancelError ?? new WorkflowError('workflow run cancelled', 'CANCELLED')\n  }\n\n  /** Materialize the script's return value; violations become RESULT_UNSERIALIZABLE. */\n  private materializeResult(raw: unknown): unknown {\n    try {\n      return materializeFromRealm(raw, 'workflow result')\n    } catch (error: unknown) {\n      /* v8 ignore next -- defensive rethrow arm: materializeFromRealm only throws MaterializeError */\n      if (!(error instanceof MaterializeError)) throw error\n      throw new WorkflowError(\n        `the workflow's return value is not plain JSON data — ${error.message}. Return only JSON-serializable objects/arrays/scalars.`,\n        'RESULT_UNSERIALIZABLE',\n        { cause: error },\n      )\n    }\n  }\n\n  /**\n   * Acquire one concurrency slot (FIFO). Cancellation rejects QUEUED waiters\n   * (see {@link cancel}); the callers guard their own entry and post-acquire\n   * windows, so no cancelled-precheck is duplicated here.\n   */\n  private acquireSlot(): Promise<void> {\n    if (this.activeSlots < this.limits.maxConcurrentAgents) {\n      this.activeSlots += 1\n      return Promise.resolve()\n    }\n    return new Promise<void>((resolve, reject) => {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/workflow-worker-thread/src/runtime.ts#L196-L232","documentation":"Error \"the workflow's return value is not plain JSON data — ${error.message}. Return only JSON-serializable objects/arrays/scalars.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/workflow-worker-thread/src/runtime.ts:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return only JSON-serializable objects, arrays, and scalars from the workflow; apply the inner error's guidance for the offending value."],"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"}