Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

bug: agentcore dev fails on mismatched regions

Đang mở Phù hợp với người mới
#1,457 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
aws, typescript
Lĩnh vực
cli, cloud

Hướng nghiên cứu

Bắt đầu trong src/cli/operations/dev/load-dev-env.ts và kiểm tra cách aws-targets.json cung cấp region triển khai cho môi trường local agent. Tái hiện dev với các resource ở một region khác và xác minh subprocess nhận được giá trị AWS_REGION tương ứng. Hoàn tất khi các thao tác tra cứu memory của local agent sử dụng target region đã cấu hình thay vì fallback region.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
291
Fork
96
Merge trung bình
20 giờ 50 phút
Pull request đã merge (30 ngày)
214

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/agentcore-cli

Tất cả issue của aws/agentcore-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.