Use AWS MemoryCreated waiter in MemoryClient._wait_for_memory_active()
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza en MemoryClient.wait_for_memory_active() e inspecciona cómo lo utilizan create_memory_and_wait(), add*_strategy_and_wait() y update_memory_strategies_and_wait(). Verifica la configuración del waiter memory_created y el comportamiento de fallback, y confirma después que delete_memory_and_wait() sigue utilizando polling manual; se considera terminado cuando los métodos afectados esperan correctamente y mantienen la compatibilidad hacia atrás.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 786
- Forks
- 163
- Merge medio
- 4 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/bedrock-agentcore-sdk-python
-
bug high-severity
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/bedrock-agentcore-sdk-python#752 ·
Los mantenedores suelen responder en 1 día
-
OpenAIConverseConverter restores an empty history when one blob or text payload fails to parseAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/bedrock-agentcore-sdk-python#751 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
delete_all_long_term_memories_in_namespace deletes only the first 10 recordsPosiblemente ocupada @Fire162 la tomó hace 18 días. Abiertobug high-severity
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
aws/bedrock-agentcore-sdk-python#727 ·
Los mantenedores suelen responder en 1 día
-
MPP: credential is always sent in Authorization, ignoring header="Payment-Authorization" in the challengePosiblemente ocupada @abhiramshaji-cyber la tomó hace 24 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws/bedrock-agentcore-sdk-python#702 ·
Los mantenedores suelen responder en 1 día
-
[Bug] update_message fails with parameter validation error when SessionMessage.message_id is a Strands positional integer indexPosiblemente ocupada @citizen204 la tomó hace 144 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws/bedrock-agentcore-sdk-python#556 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/bedrock-agentcore-sdk-python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
snap-stanford/Biomni#380 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
microsoft/playwright-python#3361 ·
Los mantenedores suelen responder en 1 día
-
documentation priority: low size: S status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
cubrid-lab/sqlalchemy-cubrid#1397 ·
Los mantenedores suelen responder en 1 día
-
documentation priority: low size: S status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cubrid-lab/pycubrid#1307 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Installer hides SSL certificate errors as bare URLError, and the suggested fix can't workAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
ShaftHQ/chaosengine-harness#143 ·
Los mantenedores suelen responder en 1 día