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(wechat): rearm bind menu hint on QR rebind

cyhdce923307752
diff --git a/tests/test_wechat_auth.py b/tests/test_wechat_auth.py
index 15d70f4da..b6e8bdd87 100644
--- a/tests/test_wechat_auth.py
+++ b/tests/test_wechat_auth.py
@@ -69,7 +69,7 @@ class WeChatAuthManagerTests(unittest.IsolatedAsyncioTestCase):
self.assertIsNotNone(user)
self.assertTrue(user.pending_bind_menu_hint) # type: ignore[union-attr]
- async def test_auto_bind_wechat_user_does_not_rearm_existing_user_hint(self):
+ async def test_auto_bind_wechat_user_rearms_existing_user_hint(self):
SettingsStore.reset_instance()
store = SettingsStore.get_instance()
store.add_user("wx-user", "WeChat User", platform="wechat")
@@ -78,4 +78,8 @@ class WeChatAuthManagerTests(unittest.IsolatedAsyncioTestCase):
self.assertTrue(result["ok"])
self.assertTrue(result["already_bound"])
- self.assertFalse(result["pending_bind_menu_hint"])
+ self.assertTrue(result["pending_bind_menu_hint"])
+
+ user = SettingsStore.get_instance().get_user("wx-user", platform="wechat")
+ self.assertIsNotNone(user)
+ self.assertTrue(user.pending_bind_menu_hint) # type: ignore[union-attr]
diff --git a/vibe/api.py b/vibe/api.py
index 0a5c152c9..e7b2264e0 100644
--- a/vibe/api.py
+++ b/vibe/api.py
@@ -4460,15 +4460,20 @@ def auto_bind_wechat_user(user_id: str) -> dict:
store = SettingsStore.get_instance()
platform = "wechat"
- # Skip if already bound
if store.is_bound_user(user_id, platform=platform):
- logger.info("WeChat user %s already bound, skipping auto-bind", user_id)
existing = store.get_user(user_id, platform=platform)
+ if existing is None:
+ logger.warning("WeChat user %s is marked bound but missing settings", user_id)
+ else:
+ existing.pending_bind_menu_hint = True
+ store.update_user(user_id, existing, platform=platform)
+ store.save()
+ logger.info("Re-armed WeChat bind menu hint for already-bound user %s", user_id)
return {
"ok": True,
"already_bound": True,
"is_admin": bool(getattr(existing, "is_admin", False)),
- "pending_bind_menu_hint": bool(getattr(existing, "pending_bind_menu_hint", False)),
+ "pending_bind_menu_hint": bool(getattr(existing, "pending_bind_menu_hint", True)),
}
config = load_config()