From 932a66877b8039ad762fb1af32824f4819a12e02 Mon Sep 17 00:00:00 2001 From: haifengqiu Date: Fri, 8 May 2026 14:03:05 +0800 Subject: [PATCH] fix: handle 202 Accepted response in demo store method When background mode is enabled (the default), the memorize endpoint returns HTTP 202 Accepted. The current code calls raise_for_status() then unconditionally parses the response as a v1 completion response, but a 202 response body lacks the expected "data.status" field, causing store() to report failure even though the request was accepted. Add an explicit 202 check after raise_for_status() to return success when the request has been queued for background processing. Co-Authored-By: Claude Opus 4.7 --- methods/EverCore/demo/utils/simple_memory_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/methods/EverCore/demo/utils/simple_memory_manager.py b/methods/EverCore/demo/utils/simple_memory_manager.py index 93898d22..4bd9a904 100644 --- a/methods/EverCore/demo/utils/simple_memory_manager.py +++ b/methods/EverCore/demo/utils/simple_memory_manager.py @@ -141,6 +141,14 @@ async def store(self, content: str, sender: str = "User") -> bool: async with httpx.AsyncClient(timeout=500.0) as client: response = await client.post(self.memorize_url, json=payload) response.raise_for_status() + + # Background mode returns 202 Accepted + if response.status_code == 202: + print( + f" ⏳ Accepted: {content[:40]}... (Processing in background)" + ) + return True + result = response.json() # v1 response: {"data": {"status": "...", "count": N, ...}}