Skip to content

armgit / avibe

Public Imported from GitHub
0

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.

fix claude runtime refresh acknowledgement

cyh5c3bff932cd3
diff --git a/tests/test_api_runtime_refresh.py b/tests/test_api_runtime_refresh.py
new file mode 100644
index 000000000..ce72ff504
--- /dev/null
+++ b/tests/test_api_runtime_refresh.py
@@ -0,0 +1,17 @@
+from __future__ import annotations
+
+import sys
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+
+from vibe import api
+
+
+def test_restart_backend_reports_claude_failure_when_controller_unacknowledged(monkeypatch) -> None:
+ monkeypatch.setattr(api, "_request_controller_restart", lambda name: (False, None))
+
+ result = api.restart_backend("claude")
+
+ assert result["ok"] is False
+ assert "not acknowledged" in result["message"]
diff --git a/vibe/api.py b/vibe/api.py
index 1b722fb4c..089941363 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -2188,9 +2188,9 @@ def restart_backend(name: str) -> dict:
Preferred path: drop a runtime-command marker that the controller
observes and reacts to via ``_refresh_backend_runtime``. This keeps the
controller's in-memory transport/session state consistent. If the
- controller isn't running (e.g. service not yet started), we fall back to
- killing the OS process directly — the controller's recovery logic will
- rebuild state when it next starts.
+ controller isn't running (e.g. service not yet started), backends with a
+ separate runtime can fall back to killing their OS process directly — the
+ controller's recovery logic will rebuild state when it next starts.
Claude has no separate daemon, but the controller keeps SDK sessions
and a loaded compat config; the marker path refreshes those in memory.
@@ -2226,7 +2226,10 @@ def restart_backend(name: str) -> dict:
return {"ok": False, "message": "Failed to stop OpenCode server."}
if name == "claude":
- return {"ok": True, "message": "Claude runtime is not running in the controller; next request will use current settings."}
+ return {
+ "ok": False,
+ "message": "Claude runtime refresh was not acknowledged by the controller; retry after the service is running.",
+ }
# codex fallback: kill app-server processes; controller recovery rebuilds.
try: