Skip to content

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
MrTrenchTrucker:fix/memory-extension-error-handling-v16
Open

Fix: Memory extension error handling -- _91_recall_wait.py crash + _50_memorize_fragments.py AuthError guard#1412
MrTrenchTrucker wants to merge 2 commits intoagent0ai:developmentfrom
MrTrenchTrucker:fix/memory-extension-error-handling-v16

Conversation

@MrTrenchTrucker
Copy link
Copy Markdown

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 task has no error handling. When _50_recall_memories.py's
asyncio.wait_for(timeout=SEARCH_TIMEOUT) fires, CancelledError propagates uncaught and
crashes the entire message loop.

CancelledError is a BaseException -- generic except Exception blocks do not catch it.

Change: Wrapped await task in try/except catching TimeoutError, CancelledError, and
Exception. Agent logs warning and continues without memory context.

Fix 2: _50_memorize_fragments.py -- Missing AuthenticationError guard

Added explicit AuthenticationError catch on call_utility_model with diagnostic logging.
Matches the pattern already present in _51_memorize_solutions.py.

Test Results (Production)

  • Before: message loop crashes on every timeout
  • After: 0 crashes, 22 graceful catches, 100% availability

Full Whitepaper

https://github.com/MrTrenchTrucker/agent-zero-v16-memory-extension-fix

Related

…, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant