Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] update_message fails with parameter validation error when SessionMessage.message_id is a Strands positional integer index

オープン 初心者向け
#556 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@citizen204 がすでに取り組んでいます。

2026年6月30日 から。

  • #558 @citizen204 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
aws, python
領域
api, backend

調査の方向性

src/bedrock_agentcore/memory/integrations/strands/session_manager.py から始め、update_message と _latest_agent_message を設定する create_message/create_event パスに注目します。SessionMessage.message_id にどの識別子が格納されるかを追跡し、その後、最新のメッセージを redact するとパラメータ検証エラーなしでイベントが削除され、AWS イベント ID が保持されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
When redact_latest_message is triggered (e.g. via guardrail redaction), update_message attempts to delete the old AWS event using session_message.message_id as the eventId.

However, Strands' SessionMessage.message_id is a sequential integer index (e.g. 4), not an AWS eventId string (e.g. "4#abc123f"). The AWS delete_event API requires eventId to be a string matching [0-9]+#[a-fA-F0-9]+, so botocore rejects the integer at parameter validation, causing the redaction to fail with

Error

Failed to update message: could not delete old event: Parameter validation failed: Invalid type for parameter eventId, value: 4, type: <class 'int'>, valid types: <class 'str'>

To Reproduce

  • Strands' RepositorySessionManager.initialize_agent calls session_repository.create_message() directly with SessionMessage objects whose message_id is a sequential integer index (0, 1, 2...). It then sets _latest_agent_message[agent_id] to the last such SessionMessage.
  • When redact_latest_message is subsequently called, it reads _latest_agent_message[agent_id] and passes it to update_message.
  • update_message extracts old_message_id = session_message.message_id -> this is the integer 4, not an AWS eventId string.
  • It then calls gmdp_client.delete_event(eventId=old_message_id), but the AWS API requires eventId to match pattern [0-9]+#[a-fA-F0-9]+ (e.g. "4#abc123f"), so botocore rejects the integer with a ParamValidationError.

Expected behavior
_latest_agent_message[agent_id].message_id should always contain the AWS eventId string returned by create_event, not the Strands positional integer index.

Where
src/bedrock_agentcore/memory/integrations/strands/session_manager.py, update_message -> delete_event call.

主要言語
Python
スター
776
フォーク
153
平均マージ
1日 8時間
マージ済み PR(30日)
15

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/bedrock-agentcore-sdk-python のほかの issue

aws/bedrock-agentcore-sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。