Skip to content

[BUG] Interrupts - Multi-Agent - AfterNodeCallEvent Emitted on Interrupt #1538

@pgrayy

Description

@pgrayy

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

Latest

Python Version

Latest

Operating System

Mac

Installation Method

pip

Steps to Reproduce

For both Graph and Swarm, the AfterNodeCallEvent is emitted even if a node is interrupted. This does not match the behavior for tool calls, which do not emit AfterToolCallEvents when interrupted.

To reproduce, you can run the integ tests under test_integ/interrupts/multiagent.

Expected Behavior

AfterNodeCallEvent should not emit if a node is interrupted. For single-agents, if a tool is interrupted, we do not emit the AfterToolCallEvent (src). There are a few motivations for this behavior:

  • AfterToolCallEvent expects a tool result which we won't have until after the tool finishes executing.
  • By its name, AfterToolCallEvent should happen after the tool is called, which is not the case if we are in the middle of processing an interrupt.

We should match this behavior for the node calls in multi-agents.

Actual Behavior

AfterNodeCallEvents emit even when a node is interrupted.

Additional Context

No response

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-hilHuman in the loop and suspend/resumearea-multiagentMulti-agent relatedbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions