{"record":{"id":"95059cd667606696","repo":"deepseek-ai/deepseek-harness","slug":"workflow-tool-requires-a-calling-agent-exec-agent","errorCode":null,"errorMessage":"workflow tool requires a calling agent (exec.agent was undefined)","messagePattern":"workflow tool requires a calling agent \\(exec\\.agent was undefined\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-workflow/src/index.ts","lineNumber":278,"sourceCode":"        additionalProperties: false,\n        properties: {\n          runId: { type: 'string', required: true },\n          agentsStarted: { type: 'integer', required: true },\n          result: { type: 'json', required: true },\n        },\n      },\n      render: (args, value) => [{\n        type: 'text',\n        text: renderResult(args.meta.name, value.agentsStarted, value.result, maxResultChars),\n      }],\n    },\n    async execute(args, exec) {\n      const parent = exec.agent\n      if (!parent) {\n        // The loop sets `exec.agent` for every model-driven call; its absence\n        // means a non-agent caller invoked the tool directly, which has no\n        // parent to attribute the children to. Fail loud rather than guess.\n        throw new Error('workflow tool requires a calling agent (exec.agent was undefined)')\n      }\n\n      // Meta/body validation failures (META_INVALID/SCRIPT_PARSE) throw\n      // synchronously here and become isError results via the registry — the\n      // model sees the violation list and can correct the call.\n      const run = ctx.workflowEngine.start({\n        script: args.script,\n        meta: args.meta,\n        ...args.args !== undefined ? { args: args.args } : {},\n        parent,\n        signal: exec.signal,\n      })\n      const recordsRun = exec.parent === undefined\n      // The shipped worker-thread engine publishes member events from later\n      // worker messages, after start() returns and this run record is active.\n      if (recordsRun) recorder.start(parent.session, run)\n\n      // Bridge the tool's abort signal to the run: if the parent step is aborted while the","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-workflow/src/index.ts#L260-L296","documentation":"Error \"workflow tool requires a calling agent (exec.agent was undefined)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/tool-workflow/src/index.ts:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Invoke the workflow tool from an agent context; compose the agent plugin so exec.agent is populated before the tool runs."],"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"}