Summary
Required automatic memory recall can abort a turn with an unhandled timeout when its bounded search does not finish.
Reproduction context
- Bundled
_memory plugin with automatic recall enabled and delayed recall disabled
- Local Hugging Face embedding model:
sentence-transformers/all-MiniLM-L6-v2
- Local FAISS memory index
- Recall timeout: 30 seconds
_50_recall_memories.py creates a recall task with asyncio.wait_for(..., timeout=30). _91_recall_wait.py then awaits that task. If the embedding/search exceeds the budget, the timeout currently propagates through prompt preparation.
Required behavior
In a memory-required harness, a timed-out automatic recall must be visible and fail closed:
- do not call the main model or generate a response without the required recalled-memory context;
- record a concise user-visible error that the response was blocked because memory recall timed out;
- preserve normal
asyncio.CancelledError propagation;
- handle a completed failed task as well as a task still pending at the wait point.
Proposed fix
Catch only asyncio.TimeoutError at the recall-wait boundary, clear the failed recall task, log a concise error, and raise the framework's HandledException to terminate that turn in controlled fashion. This prevents an uninformed contribution while avoiding an unhandled traceback.
Focused regression coverage verifies pending timeout blocking, already-completed timeout blocking, and cancellation propagation.
Summary
Required automatic memory recall can abort a turn with an unhandled timeout when its bounded search does not finish.
Reproduction context
_memoryplugin with automatic recall enabled and delayed recall disabledsentence-transformers/all-MiniLM-L6-v2_50_recall_memories.pycreates a recall task withasyncio.wait_for(..., timeout=30)._91_recall_wait.pythen awaits that task. If the embedding/search exceeds the budget, the timeout currently propagates through prompt preparation.Required behavior
In a memory-required harness, a timed-out automatic recall must be visible and fail closed:
asyncio.CancelledErrorpropagation;Proposed fix
Catch only
asyncio.TimeoutErrorat the recall-wait boundary, clear the failed recall task, log a concise error, and raise the framework'sHandledExceptionto terminate that turn in controlled fashion. This prevents an uninformed contribution while avoiding an unhandled traceback.Focused regression coverage verifies pending timeout blocking, already-completed timeout blocking, and cancellation propagation.