{"record":{"id":"eaab8c0dfccf8907","repo":"deepseek-ai/deepseek-harness","slug":"script-parse-eaab8c","errorCode":"SCRIPT_PARSE","errorMessage":"workflow script does not parse: ${String(error)}","messagePattern":"workflow script does not parse: (.+?)","errorType":"exception","errorClass":"WorkflowError","httpStatus":null,"severity":"error","filePath":"packages/workflow/workflow-worker-thread/src/runtime.ts","lineNumber":95,"sourceCode":"    body: string,\n    args: unknown,\n    private readonly limits: WorkerLimits,\n    private readonly observer: ExecutionObserver,\n    private readonly children: ChildPort,\n  ) {\n    // Compile FIRST: a body syntax error must throw out of the constructor\n    // before any realm state exists. The host pre-parses the identical\n    // wrapper, so under one Node version this throw is unreachable in\n    // production — the session still maps it to an error result defensively.\n    // lineOffset compensates for the wrapper line, so stack traces carry the\n    // script's own line numbers.\n    try {\n      this.compiled = new vm.Script(`(async () => {\\n${body}\\n})()`, {\n        filename: `workflow:${meta.name}`,\n        lineOffset: -1,\n      })\n    } catch (error: unknown) {\n      throw new WorkflowError(`workflow script does not parse: ${String(error)}`, 'SCRIPT_PARSE', { cause: error })\n    }\n\n    this.context = vm.createContext({}, { name: `workflow:${meta.name}` })\n\n    const globals: Record<string, unknown> = {\n      agent: (prompt: unknown, opts?: unknown) => this.contain(this.agent(prompt, opts)),\n      parallel: (thunks: unknown) => this.contain(this.parallel(thunks)),\n      pipeline: (items: unknown, ...stages: unknown[]) => this.contain(this.pipeline(items, stages)),\n      phase: (title: unknown) => { this.phase(title) },\n      log: (message: unknown) => { this.log(message) },\n      // workerData already performed the real cross-thread structured clone.\n      args,\n    }\n    for (const [key, value] of Object.entries(globals)) {\n      // Data properties on the contextified global; frozen shape not required —\n      // a script overwriting its own hooks only sabotages itself.\n      ;(this.context as Record<string, unknown>)[key] = typeof value === 'function' ? Object.freeze(value) : value\n    }","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/workflow-worker-thread/src/runtime.ts#L77-L113","documentation":"Error \"workflow script does not parse: ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/workflow-worker-thread/src/runtime.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the workflow script syntax so it parses as a module; the parse error text names the offending construct."],"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"}