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.

refactor(settings): simplify normalization by not handling legacy int keys\n\n- Normalize user_id to string only; drop legacy int key migration logic for simplicity

cyhhao8cc8a071a792
diff --git a/modules/settings_manager.py b/modules/settings_manager.py
index 56f45f60b..0cf54916a 100644
--- a/modules/settings_manager.py
+++ b/modules/settings_manager.py
@@ -43,7 +43,7 @@ class SettingsManager:
# ---------------------------------------------
def _normalize_user_id(self, user_id: Union[int, str]) -> str:
"""Normalize user_id consistently to string.
-
+
Rationale: JSON object keys are strings; Slack IDs are strings; unifying to
string avoids mixed-type keys (e.g., 123 vs "123").
"""
@@ -116,7 +116,10 @@ class SettingsManager:
# Remove legacy int key if exists
try:
int_form = int(normalized_id)
- if int_form in self.settings and self.settings.get(normalized_id) is not self.settings[int_form]:
+ if (
+ int_form in self.settings
+ and self.settings.get(normalized_id) is not self.settings[int_form]
+ ):
del self.settings[int_form]
except Exception:
pass