Skip to content

Conversation

@pgrayy
Copy link
Member

@pgrayy pgrayy commented Oct 27, 2025

Description

Raise an exception if a user tries to directly call a tool that interrupts.

We cannot support interrupts in direct tool calls because there is no means for users to pass interruptResponses through the agent.tool.my_tool(...) call. I don't think it needs to be supported regardless because direct tool calls are already intentional (i.e., it is a user call, not a model call).

Related Issues

#204

Documentation PR

N/A

Type of Change

  • Documentation update: Currently, interrupting a direct tool call leads to an IndexError because there are no tool results to extract from the tool_results array. Raising an explicit RuntimeError instead thus won't cause any backwards incompatibility issues.

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

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.

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pgrayy pgrayy marked this pull request as ready for review October 27, 2025 17:04
@pgrayy pgrayy mentioned this pull request Oct 27, 2025
8 tasks
JackYPCOnline
JackYPCOnline previously approved these changes Oct 27, 2025
@pgrayy pgrayy merged commit 071f89f into strands-agents:main Oct 27, 2025
14 checks passed
@pgrayy pgrayy deleted the direct-tool-call-interrupt branch October 28, 2025 02:26
dbschmigelski pushed a commit to schnetler/sdk-python that referenced this pull request Nov 12, 2025
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