Surface transient memU backend outages instead of silently returning no memories#180
Open
serxa wants to merge 1 commit into
Open
Surface transient memU backend outages instead of silently returning no memories#180serxa wants to merge 1 commit into
serxa wants to merge 1 commit into
Conversation
…no memories memU disables SDK retries (max_retries=0), so a transient proxy/auth blip (429/5xx or the proxy 'auth_unavailable'/revoked-OAuth signature on 401/403) failed the call immediately. recall then returned an empty list — rendered as "No relevant memories found." and indistinguishable from a genuine miss (silent amnesia); memorize reported only a generic failure. Add MemoryBackendUnavailable + _is_transient_llm_error(), retry transient errors with short backoff (0.5/1.5/3.0s; genuine hangs still fail fast via the existing wait_for), and surface real outages loudly in recall/memorize so the agent knows memory is DOWN, not empty. Normal path unchanged; nothing to configure. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
memU runs its LLM client with SDK retries disabled (
max_retries=0), so a transient backend blip — HTTP 429/5xx, or the shared proxy returningauth_unavailable/ a revoked-OAuth error on 401/403 — fails the memU call immediately. The main agent SDK rides such blips out via its own retries; memU does not. The result was silent data-loss:memory_recallcaught the error and returned an empty list, rendered by the tool layer as "No relevant memories found." — indistinguishable from a genuine miss. The agent then proceeds as if it has no relevant memory: silent amnesia.memorizefailed and reported only a generic failure.Fix
MemoryBackendUnavailableand_is_transient_llm_error()— detects 429/5xx by status, plus the proxy'sauth_unavailable/ revoked signatures on 401/403, falling back to parsingError code: NNNfrom the message so it stays decoupled from theopenaiimport.wait_for; non-transient errors re-raise immediately.recall/memorize/memorize_fileraiseMemoryBackendUnavailable, and the tool layer surfaces it loudly — telling the agent memory is DOWN (not empty), so it flags/reconstructs instead of concluding "no memories".Normal-path behavior is unchanged and there is nothing to configure — the new path only triggers during a transient backend error, where the previous behavior was silent.
Testing
Full test suite:
1547 passed, 2 skipped.