Fix: Memory extension error handling -- _91_recall_wait.py crash + _50_memorize_fragments.py AuthError guard#1412
Open
MrTrenchTrucker wants to merge 2 commits intoagent0ai:developmentfrom
Conversation
…, CancelledError, and Exception The bare 'await task' crashes the message loop when memory recall times out. asyncio.wait_for in _50_recall_memories.py raises CancelledError which propagates uncaught through the bare await. This is a guaranteed crash on every memory recall timeout. Fix wraps the await in try/except catching all three failure modes. Agent logs a warning and continues without memory context.
Adds explicit AuthenticationError catch with diagnostic logging on the call_utility_model invocation. Matches the pattern already present in _51_memorize_solutions.py. Without this, NVIDIA API key misrouting produces silent failures with no diagnostic output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes for memory extension error handling gaps that cause message loop crashes in production
environments with remote API endpoints.
Fix 1: _91_recall_wait.py -- Crash on memory recall timeout
The bare
await taskhas no error handling. When_50_recall_memories.py'sasyncio.wait_for(timeout=SEARCH_TIMEOUT)fires,CancelledErrorpropagates uncaught andcrashes the entire message loop.
CancelledErroris aBaseException-- genericexcept Exceptionblocks do not catch it.Change: Wrapped
await taskin try/except catchingTimeoutError,CancelledError, andException. Agent logs warning and continues without memory context.Fix 2: _50_memorize_fragments.py -- Missing AuthenticationError guard
Added explicit
AuthenticationErrorcatch oncall_utility_modelwith diagnostic logging.Matches the pattern already present in
_51_memorize_solutions.py.Test Results (Production)
Full Whitepaper
https://github.com/MrTrenchTrucker/agent-zero-v16-memory-extension-fix
Related