Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,19 @@ def update_message(self, session_id: str, agent_id: str, session_message: Sessio
logger.debug("Message has no event ID and was not found in buffer - skipping update")
return

# Strands' RepositorySessionManager.initialize_agent passes SessionMessage objects
# whose message_id is a sequential integer index (0, 1, 2 …), not an AWS eventId
# string (e.g. "4#abc123f"). Passing an integer to delete_event causes a
# ParamValidationError at the botocore layer. Skip the update — the event
# cannot be located by a positional index alone.
if isinstance(old_message_id, int):
logger.warning(
"update_message: message_id %r is a Strands positional integer index, not an "
"AWS eventId string — skipping delete of old event (see issue #556)",
old_message_id,
)
return

# Create a new event with the updated message content
try:
updated_message = SessionMessage(
Expand Down