Skip to content

Agent that has Agent asTool that has Tool that needsApproval does not return interruptions #243

@Juicetan

Description

@Juicetan

Please read this first

  • Have you read the docs? Agents SDK docs
  • Have you searched for related issues? Others may have faced similar issues. ✅

Describe the bug

When I have an Agent as a tool that has a tool itself that has needsApproval to be true, the run result.interruptions array remains empty.

Debug information

  • Agents SDK version: v0.0.11
  • Runtime environment Node.js 22.15.1

Repro steps

Agent A has Agent B asTool in tools array

const agentA = new Agent({
  ...
  tools: [
    agentB.asTool({
      ...
    })
  ]
})

Agent B has Tool A in tools array

const agentB = new Agent({
  ...
  tools: [
    toolA
  ]
})

Tool A has needsApproval to return true

const toolA = tool({
  ...
  needsApproval: async (_ctx, _input) => {
    console.log('> approval check', _ctx, _input);
    return true;
  }
})

Run result does not return any interruptions

const result = await runner.run(agentA, conversation, promptOpts);
if(result.interruptions?.length){
  console.log('> pause for approval', JSON.stringify(result.state, null, 2));
}

Expected behavior

Expected behavior is that result.interruptions will have items, however it does not. The conversation just returns a finalOutput that implies that something is happening in the background.

What I have noticed is that if I have Agent B has a handoff within Agent A, then it works and I receive result.interruptions items, however its conversational behavior as a handoff is not what I'm trying to achieve.

Is this intended SDK behavior?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions