-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem Statement
My team has an AgentCore stands-based agent which we invoke via an AWS SDK client. This client has built in retry logic for various transient issues such as network errors and timeouts.
In some cases, our client will send a request to our agent, and the request will make it through and kickoff the invocation, but the client performs a retry anyway (this is not uncommon behavior across clients). When this happens, the same request is sent a second time. Unfortunately, when this occurs, the particular user session that is being invoked twice enters in unrecoverable state, and all subsequent requests to the same session fail.
This is due to getting the following exception: An error occurred (ValidationException) when calling the ConverseStream operation: Expected toolResult blocks at messages.6.content for the following Ids: tooluse_YQlhVQVOSdGbSXxRz5ZoyQ, but found: tooluse_LmVFH7_rSp-QJwfc1WvVsw (among other variations).
Proposed Solution
It would be helpful if when the strands agent is invoked with the same request a second time, that it simply waits for the first request to finish before returning the response, rather than executing a second invocation.
Use Case
Users would not have to implement their own idempotency logic on the client side to prevent this issue from happening. This will likely occur commonly across many use cases, as using clients with internal retry logic is typical.
Alternatives Solutions
No response
Additional Context
No response