deepseek-ai/deepseek-harness · error · Error

workflow tool requires a calling agent (exec.agent was undef

Error message

workflow tool requires a calling agent (exec.agent was undefined)

What it means

Error "workflow tool requires a calling agent (exec.agent was undefined)" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/workflow/tool-workflow/src/index.ts:278

        additionalProperties: false,
        properties: {
          runId: { type: 'string', required: true },
          agentsStarted: { type: 'integer', required: true },
          result: { type: 'json', required: true },
        },
      },
      render: (args, value) => [{
        type: 'text',
        text: renderResult(args.meta.name, value.agentsStarted, value.result, maxResultChars),
      }],
    },
    async execute(args, exec) {
      const parent = exec.agent
      if (!parent) {
        // The loop sets `exec.agent` for every model-driven call; its absence
        // means a non-agent caller invoked the tool directly, which has no
        // parent to attribute the children to. Fail loud rather than guess.
        throw new Error('workflow tool requires a calling agent (exec.agent was undefined)')
      }

      // Meta/body validation failures (META_INVALID/SCRIPT_PARSE) throw
      // synchronously here and become isError results via the registry — the
      // model sees the violation list and can correct the call.
      const run = ctx.workflowEngine.start({
        script: args.script,
        meta: args.meta,
        ...args.args !== undefined ? { args: args.args } : {},
        parent,
        signal: exec.signal,
      })
      const recordsRun = exec.parent === undefined
      // The shipped worker-thread engine publishes member events from later
      // worker messages, after start() returns and this run record is active.
      if (recordsRun) recorder.start(parent.session, run)

      // Bridge the tool's abort signal to the run: if the parent step is aborted while the

View on GitHub (pinned to b150a551b8)

Solutions

  1. Invoke the workflow tool from an agent context; compose the agent plugin so exec.agent is populated before the tool runs.

When it happens

Trigger: Thrown at packages/workflow/tool-workflow/src/index.ts:278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/95059cd667606696. Report an issue: GitHub.