Skip to content

Conversation

zastrowm
Copy link
Member

Description

Fixes the wrong message being emitted as a result of a tool call.

This also expands the unit tests for the yielded event to verify actual tool calls - previous to this, the events were not being emitted because the test was bailing out due to mocked guard rails. To better test the situation, we now have a much more extensive test for the successful tool call.

This was caught as part of prep for tool streaming; while debugging this, I also realized that tools that currently return an async generator are not working correctly, as the "result" provided looks like an async-generator stringified - this behavior predates the typed event changes though and should be fixed as part of #543 :

<async_generator object streaming_tool at 0x107d18a00>

Related Issues

#242, #543

Documentation PR

N/A

Type of Change

Bug fix

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.

Expand the Unit Tests for the yielded event to verify actual tool calls - previous to this, the events were not being emitted because the test was bailing out due to mocked guard rails.  To better test the situation, we now have a much more extensive test for the successful tool call
@zastrowm zastrowm merged commit cb4b7fb into strands-agents:main Aug 29, 2025
13 of 16 checks passed
@zastrowm zastrowm deleted the tool_streaming branch August 29, 2025 20:24
Ratish1 pushed a commit to Ratish1/sdk-python that referenced this pull request Aug 30, 2025
Expand the Unit Tests for the yielded event to verify actual tool calls - previous to this, the events were not being emitted because the test was bailing out due to mocked guard rails.  To better test the situation, we now have a much more extensive test for the successful tool call

Co-authored-by: Mackenzie Zastrow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants