Skip to content

Conversation

@pgrayy
Copy link
Member

@pgrayy pgrayy commented Jan 21, 2026

Description

Allow users to raise interrupts from an agent node in Graph. This is a follow up to #1478 and an iteration on #1350.

Usage

from strands import Agent, tool
from strands.interrupt import Interrupt
from strands.multiagent import GraphBuilder, Status
from strands.types.tools import ToolContext

@tool(context=True)
def weather_tool(tool_context: ToolContext) -> str:
    response = tool_context.interrupt("weather_interrupt", reason="need weather")
    return response

weather_agent = Agent(name="weather")

builder = GraphBuilder()
builder.add_node(weather_agent, "weather_agent")
graph = builder.build()

multiagent_result = graph("What is the weather?")
while multiagent_result.status == Status.INTERRUPTED:
    responses = []
    for interrupt in multiagent_result.interrupts:
        if interrupt.name == "weather_interrupt":
            response = input(f"{interrupt.reason}: ")
            responses.append(
                {
                    "interruptResponse": {
                         "interruptId": interrupt.id,
                         "response": response,
                    },
                },
             )

    multiagent_result = graph(responses)

print(multiagent_result.results)

Follow Up

Support raising an interrupt from a multi-agent node. There are some special considerations with session management to get this working properly.

Related Issues

#204

Documentation PR

Will update https://strandsagents.com/latest/documentation/docs/user-guide/concepts/interrupts/#multi-agents in follow up. Note, swarm interrupt docs have been added but not yet released.

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare: Wrote new unit tests
  • I ran hatch test tests_integ/interrupts/multiagent: Wrote new integ tests

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Co-authored-by: Mohammad Salehan <salehanw@amazon.com.com>
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/strands/multiagent/graph.py 94.11% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@pgrayy pgrayy changed the title graph - interrupt - agent interrupts - graph - agent based Jan 21, 2026
@pgrayy pgrayy mentioned this pull request Jan 21, 2026
7 tasks
@pgrayy pgrayy marked this pull request as ready for review January 21, 2026 19:46
@pgrayy pgrayy merged commit fa86444 into strands-agents:main Jan 23, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants