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(config): reconcile primary-only platform changes

cyh9c9d8c709772
diff --git a/tests/test_ui_server_fastapi.py b/tests/test_ui_server_fastapi.py
index cb49e5ce0..3347591b1 100644
--- a/tests/test_ui_server_fastapi.py
+++ b/tests/test_ui_server_fastapi.py
@@ -376,6 +376,31 @@ def test_config_post_hot_reconciles_platform_runtime_credential_change(monkeypat
assert reconcile_calls == [True]
+def test_platform_runtime_fields_changed_detects_primary_only_change():
+ from config.v2_config import V2Config
+
+ payload = _full_config_payload()
+ payload["platforms"] = {"enabled": ["discord", "slack"], "primary": "discord"}
+ payload["slack"] = {"bot_token": "xoxb-hot-token", "app_token": "xapp-hot-token"}
+ previous = V2Config.from_payload(payload)
+ current = V2Config.from_payload(
+ {
+ **payload,
+ "platform": "slack",
+ "platforms": {"enabled": ["discord", "slack"], "primary": "slack"},
+ }
+ )
+
+ assert (
+ ui_server._platform_runtime_fields_changed(
+ previous,
+ current,
+ {"platforms": {"enabled": ["discord", "slack"], "primary": "slack"}},
+ )
+ is True
+ )
+
+
def test_config_post_non_platform_change_does_not_reconcile_platforms(monkeypatch, tmp_path):
monkeypatch.setenv("VIBE_REMOTE_HOME", str(tmp_path))
from vibe import api
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index 0f94c2e79..4696e80a5 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -1039,6 +1039,7 @@ def _platform_runtime_fields_changed(previous: V2Config | None, current: V2Confi
return False
return (
set(previous.platforms.enabled) != set(current.platforms.enabled)
+ or previous.platforms.primary != current.platforms.primary
or _platform_runtime_signature(previous) != _platform_runtime_signature(current)
)