Use AWS MemoryCreated waiter in MemoryClient._wait_for_memory_active()
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 MemoryClient.wait_for_memory_active() 開始,檢查 create_memory_and_wait()、add*_strategy_and_wait() 和 update_memory_strategies_and_wait() 如何使用它。驗證 memory_created waiter 的設定和 fallback 行為,然後確認 delete_memory_and_wait() 仍然使用手動輪詢;當受影響的方法能夠成功等待並維持向後相容性時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Summary
Replace manual polling in MemoryClient._wait_for_memory_active() with the AWS memory_created waiter for more efficient waiting.
Current Implementation
The current _wait_for_memory_active() method uses manual polling with a default 10-second interval:
def _wait_for_memory_active(self, memory_id: str, max_wait: int, poll_interval: int) -> Dict[str, Any]:
start_time = time.time()
while time.time() - start_time < max_wait:
status = self.get_memory_status(memory_id)
if status == MemoryStatus.ACTIVE.value:
return memory
elif status == MemoryStatus.FAILED.value:
raise RuntimeError(...)
time.sleep(poll_interval) # Default: 10 seconds
raise TimeoutError(...)
Proposed Implementation
Use the memory_created waiter (confirmed available in boto3):
def _wait_for_memory_active(self, memory_id: str, max_wait: int = 300, poll_interval: int = 2) -> Dict[str, Any]:
try:
waiter = self.gmcp_client.get_waiter('memory_created')
waiter.wait(
memoryId=memory_id,
WaiterConfig={
'Delay': poll_interval,
'MaxAttempts': max_wait // poll_interval
}
)
# Get final memory state
response = self.gmcp_client.get_memory(memoryId=memory_id)
return self._normalize_memory_response(response["memory"])
except Exception:
# Fallback to manual polling for backwards compatibility
return self._wait_for_memory_active_polling(memory_id, max_wait, poll_interval)
Benefits
| Aspect | Manual Polling | AWS Waiter |
|---|---|---|
| Default poll interval | 10s | 2s |
| Error handling | Custom | AWS-managed |
| Retry logic | Custom | Built-in |
| Maintenance | SDK team | AWS/botocore |
Affected Methods
This change would improve the following methods that use _wait_for_memory_active():
create_memory_and_wait()add_*_strategy_and_wait()methodsupdate_memory_strategies_and_wait()
Backwards Compatibility
Include fallback to manual polling if:
- Waiter is not available in older boto3 versions
- Waiter fails unexpectedly
Notes
- The
memory_createdwaiter is confirmed available:client.waiter_namesreturns['memory_created'] - No
memory_deletedwaiter exists, sodelete_memory_and_wait()must continue using manual polling
- 主要語言
- Python
- 星號
- 786
- 分支
- 163
- 平均合併
- 4 小時
- 30 天內合併 PR
- 22
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/bedrock-agentcore-sdk-python 的其他 Issue
-
bug high-severity
難度 2/5 1-3 小時 新手友好度 72/100
aws/bedrock-agentcore-sdk-python#752 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
aws/bedrock-agentcore-sdk-python#751 · 1 個 reaction ·
維護者通常 1 天內回覆
-
delete_all_long_term_memories_in_namespace deletes only the first 10 records可能已有人在做 @Fire162 於 18 天前認領。 未關閉bug high-severity
難度 2/5 1-3 小時 新手友好度 75/100
aws/bedrock-agentcore-sdk-python#727 ·
維護者通常 1 天內回覆
-
MPP: credential is always sent in Authorization, ignoring header="Payment-Authorization" in the challenge可能已有人在做 @abhiramshaji-cyber 於 24 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 68/100
aws/bedrock-agentcore-sdk-python#702 ·
維護者通常 1 天內回覆
-
[Bug] update_message fails with parameter validation error when SessionMessage.message_id is a Strands positional integer index可能已有人在做 @citizen204 於 144 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
aws/bedrock-agentcore-sdk-python#556 ·
維護者通常 1 天內回覆
查看 aws/bedrock-agentcore-sdk-python 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
snap-stanford/Biomni#380 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
microsoft/playwright-python#3361 ·
維護者通常 1 天內回覆
-
documentation priority: low size: S status: needs triage
難度 2/5 1-3 小時 新手友好度 74/100
cubrid-lab/sqlalchemy-cubrid#1397 ·
維護者通常 1 天內回覆
-
documentation priority: low size: S status: needs triage
難度 2/5 1-3 小時 新手友好度 72/100
cubrid-lab/pycubrid#1307 ·
維護者通常 1 天內回覆
-
[Bug]: Installer hides SSL certificate errors as bare URLError, and the suggested fix can't work未關閉bug
難度 2/5 1-3 小時 新手友好度 80/100
ShaftHQ/chaosengine-harness#143 ·
維護者通常 1 天內回覆