Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug: agentcore dev fails on mismatched regions

未关闭 适合新手
#1,457 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
aws, typescript
领域
cli, cloud

调研方向

从 src/cli/operations/dev/load-dev-env.ts 开始,检查 aws-targets.json 如何向本地代理环境提供部署区域。在不同区域的资源上复现 dev,并验证子进程接收到匹配的 AWS_REGION 值。当本地代理的内存查找使用配置的目标区域而不是回退区域时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug
Problem

Invoking local agent is failing with memory not found:

Web UI: [MyAgent1] {"timestamp": "2026-06-03T17:24:11.698Z", "level": "ERROR", "message": "Error in sync streaming", "logger": "bedrock_agentcore.app", "requestId": "********-****-****-****-************",
   "sessionId": "********-****-****-****-************", "errorType": "ResourceNotFoundException", "errorMessage": "An error occurred (ResourceNotFoundException) when calling the ListEvents operation: Memory not
   found: ************************************", "stackTrace": ["Traceback (most recent call last):\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 886,
   in _sync_stream_with_error_handling\n    for value in generator:\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 747, in _async_gen_to_sync_gen\n
   raise value\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py\", line 736, in _produce\n    async for chunk in async_gen:\n", "  File
   \"/****/app/MyAgent1/main.py\", line 60, in invoke\n    agent = get_or_create_agent(session_id, user_id)\n", "  File \"/****/app/MyAgent1/main.py\", line 45, in get_or_create_agent\n
   session_manager=get_memory_session_manager(session_id, user_id),\n", "  File \"/****/app/MyAgent1/memory/session.py\", line 20, in get_memory_session_manager\n    return AgentCoreMemorySessionManager(\n", "
   File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/integrations/strands/session_manager.py\", line 202, in __init__\n    super().__init__(session_id=self.config.session_id,
   session_repository=self)\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/strands/session/repository_session_manager.py\", line 51, in __init__\n    session =
   session_repository.read_session(session_id)\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/integrations/strands/session_manager.py\", line 318, in read_session\n
   events = self.memory_client.list_events(\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/memory/client.py\", line 887, in list_events\n    response =
   self.gmdp_client.list_events(**params)\n", "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/client.py\", line 606, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n",
   "  File \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/opentelemetry/instrumentation/botocore/__init__.py\", line 334, in _patched_api_call\n    result = original_func(*args, **kwargs)\n", "  File
   \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/context.py\", line 123, in wrapper\n    return func(*args, **kwargs)\n", "  File
   \"/****/app/MyAgent1/.venv/lib/python3.10/site-packages/botocore/client.py\", line 1094, in _make_api_call\n    raise error_class(parsed_response, operation_name)\n",
   "botocore.errorfactory.ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the ListEvents operation: Memory not found: ************************************\n"], "location":
   "/****/app/MyAgent1/.venv/lib/python3.10/site-packages/bedrock_agentcore/runtime/app.py:_sync_stream_with_error_handling:889"}

The issue appears to be that the CLI does not inject the AWS_REGION env var into the local agent subprocess. This causes boto3 to try to fallback to a default that may not match the region that resoruces are deployed in. (source: https://docs.aws.amazon.com/boto3/latest/guide/configuration.html).

For example, my memory was in us-east-1, but its searching us-west-2.

Potential Fix

Looks like we may need to add the region from the aws-targets.json to the dev env here: https://github.com/aws/agentcore-cli/blob/main/src/cli/operations/dev/load-dev-env.ts#L16.

主要语言
TypeScript
星标
291
派生
96
平均合并
17 小时 29 分钟
30 天内合并 PR
193

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/agentcore-cli 的其他 Issue

查看 aws/agentcore-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。