Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(memory): validate empty probe metadata safely
cyh80a7f3401986
diff --git a/core/memory/everos.py b/core/memory/everos.pyindex 15b9d306c..1ab2bafa9 100644--- a/core/memory/everos.py+++ b/core/memory/everos.py@@ -1606,12 +1606,14 @@ def _chat_probe_response_issue(value: Any) -> str | None:content = message["content"]if not isinstance(content, str):return "provider_response_invalid_content"- if not content:+ if not content.strip():if message.get("role") != "assistant":return "provider_response_invalid_role"finish_reason = choices[0].get("finish_reason")if finish_reason is None:return "provider_response_missing_finish_reason"+ if not isinstance(finish_reason, str):+ return "provider_response_invalid_finish_reason"if finish_reason not in _CHAT_PROBE_TERMINAL_FINISH_REASONS:return "provider_response_invalid_finish_reason"return Nonediff --git a/tests/test_memory_everos.py b/tests/test_memory_everos.pyindex d13b82a35..86c3ca6c8 100644--- a/tests/test_memory_everos.py+++ b/tests/test_memory_everos.py@@ -1525,6 +1525,8 @@ def test_processing_preflight_reports_the_rejected_2xx_shape() -> None:[({"content": ""}, "provider_response_invalid_role"),({"role": "assistant", "content": ""}, "provider_response_missing_finish_reason"),+ ({"content": " "}, "provider_response_invalid_role"),+ ({"role": "assistant", "content": " "}, "provider_response_missing_finish_reason"),],)def test_processing_preflight_requires_completion_metadata_for_empty_chat_content(@@ -1558,6 +1560,46 @@ def test_processing_preflight_requires_completion_metadata_for_empty_chat_contenassert result.failure.diagnostic.message == expected+def test_processing_preflight_rejects_unhashable_finish_reason() -> None:+ def handler(request: httpx.Request) -> httpx.Response:+ if request.url.path.endswith("/chat/completions"):+ return httpx.Response(+ 200,+ json={+ "choices": [+ {+ "finish_reason": {},+ "message": {"role": "assistant", "content": ""},+ }+ ]+ },+ )+ return httpx.Response(200, json={"data": [{"embedding": [0.1]}]})++ async def run():+ return await EverOSPort(+ Path("/tmp/everos.sock"),+ llm_base_url="https://llm.example.test/v1",+ llm_model="chat",+ llm_api_key="secret",+ embedding_base_url="https://embed.example.test/v1",+ embedding_model="embed",+ embedding_api_key="secret",+ ).preflight()++ real_async_client = httpx.AsyncClient+ with patch("core.memory.everos.httpx.AsyncClient", autospec=True) as client_type:+ client_type.side_effect = lambda **kwargs: real_async_client(+ transport=httpx.MockTransport(handler), **kwargs+ )+ result = asyncio.run(run())++ assert result.ok is False+ assert result.failure is not None+ assert result.failure.diagnostic.http_status == 200+ assert result.failure.diagnostic.message == "provider_response_invalid_finish_reason"++def test_processing_preflight_probes_configured_rerank_endpoint() -> None:requests: list[httpx.Request] = []recorded: list[dict[str, object]] = []