-
Notifications
You must be signed in to change notification settings - Fork 335
fix: Properly handle prompt=None & avoid agent hanging #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+16
−7
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zastrowm
commented
Aug 8, 2025
5f6f85f
to
3ad53b6
Compare
zastrowm
commented
Aug 8, 2025
dbschmigelski
previously approved these changes
Aug 11, 2025
Previously (strands-agents#642) bedrock would hang during message conversion because the exception was not being caught and thus the queue was always empty. Now all exceptions during conversion are caught
73ca87f
to
b47b675
Compare
dbschmigelski
approved these changes
Aug 12, 2025
3 tasks
JackYPCOnline
added a commit
that referenced
this pull request
Aug 19, 2025
* fix: fix non-serializable parameter of agent from toolUse block * feat: Add configuration option to MCP Client for server init timeout (#657) Co-authored-by: Harry Wilton <fhwilton@amazon.com> * fix: Bedrock hang when exception occurs during message conversion (#643) Previously (#642) bedrock would hang during message conversion because the exception was not being caught and thus the queue was always empty. Now all exceptions during conversion are caught Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com> * fix: only include parameters that defined in tool spec --------- Co-authored-by: Jack Yuan <jackypc@amazon.com> Co-authored-by: fhwilton55 <81768750+fhwilton55@users.noreply.github.com> Co-authored-by: Harry Wilton <fhwilton@amazon.com> Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com> Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
3 tasks
dbschmigelski
pushed a commit
to dbavro19/sdk-python
that referenced
this pull request
Aug 28, 2025
…rands-agents#643) Previously (strands-agents#642) bedrock would hang during message conversion because the exception was not being caught and thus the queue was always empty. Now all exceptions during conversion are caught Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
dbschmigelski
pushed a commit
to dbavro19/sdk-python
that referenced
this pull request
Aug 28, 2025
…nds-agents#568) * fix: fix non-serializable parameter of agent from toolUse block * feat: Add configuration option to MCP Client for server init timeout (strands-agents#657) Co-authored-by: Harry Wilton <fhwilton@amazon.com> * fix: Bedrock hang when exception occurs during message conversion (strands-agents#643) Previously (strands-agents#642) bedrock would hang during message conversion because the exception was not being caught and thus the queue was always empty. Now all exceptions during conversion are caught Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com> * fix: only include parameters that defined in tool spec --------- Co-authored-by: Jack Yuan <jackypc@amazon.com> Co-authored-by: fhwilton55 <81768750+fhwilton55@users.noreply.github.com> Co-authored-by: Harry Wilton <fhwilton@amazon.com> Co-authored-by: Mackenzie Zastrow <3211021+zastrowm@users.noreply.github.com> Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Avoid hanging when
prompt=None
is passed into Agent - catch all exceptionsBedrockModel._stream
so that theawait queue.get()
always completessdk-python/src/strands/models/bedrock.py
Line 391 in 8b1de4d
Revisions
Related Issues
#642
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
hatch run prepare
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.