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(review): address 1 critical + 4 improvement findings from code review
cyh929842c53198
diff --git a/config/v2_settings.py b/config/v2_settings.pyindex 771f0b8cd..f793f44b7 100644--- a/config/v2_settings.py+++ b/config/v2_settings.py@@ -426,6 +426,9 @@ class SettingsStore:if bc.type == "expiring" and bc.expires_at:try:expires = datetime.fromisoformat(bc.expires_at)+ # If only a date was provided (no time component), treat as end-of-day+ if expires.hour == 0 and expires.minute == 0 and expires.second == 0 and "T" not in bc.expires_at:+ expires = expires.replace(hour=23, minute=59, second=59)# Ensure timezone-aware comparisonif expires.tzinfo is None:expires = expires.replace(tzinfo=timezone.utc)diff --git a/core/controller.py b/core/controller.pyindex 4d6c90e1b..c35d9b914 100644--- a/core/controller.py+++ b/core/controller.py@@ -725,8 +725,9 @@ class Controller:# Save settings - using the correct method nameself.settings_manager.update_user_settings(settings_key, user_settings)- # Save require_mention setting- self.settings_manager.set_require_mention(settings_key, require_mention)+ # Save require_mention setting (channel-only, not applicable in DM)+ if not is_dm:+ self.settings_manager.set_require_mention(settings_key, require_mention)# Save language setting to global configlanguage_saved = Truediff --git a/core/handlers/session_handler.py b/core/handlers/session_handler.pyindex 5e13c8307..428de9d86 100644--- a/core/handlers/session_handler.py+++ b/core/handlers/session_handler.py@@ -99,8 +99,8 @@ class SessionHandler:settings_key = self._get_settings_key(context)stored_claude_session_id = self.settings_manager.get_claude_session_id(settings_key, base_session_id)- # Read channel-level configuration overrides- channel_settings = self.settings_manager.get_channel_settings(context.channel_id)+ # Read configuration overrides using settings_key (user_id for DM, channel_id for channels)+ channel_settings = self.settings_manager.get_channel_settings(settings_key)routing = channel_settings.routing if channel_settings else None# Priority: subagent params > channel config > agent frontmatter > global defaultdiff --git a/core/handlers/settings_handler.py b/core/handlers/settings_handler.pyindex 1b12a6ecb..44cbbcbfe 100644--- a/core/handlers/settings_handler.py+++ b/core/handlers/settings_handler.py@@ -170,6 +170,7 @@ class SettingsHandler:current_require_mention=current_require_mention,global_require_mention=global_require_mention,current_language=current_language,+ owner_user_id=context.user_id,)returnawait self._handle_settings_traditional(context)diff --git a/modules/agents/codex_agent.py b/modules/agents/codex_agent.pyindex d1f07fc3d..5304374ec 100644--- a/modules/agents/codex_agent.py+++ b/modules/agents/codex_agent.py@@ -55,8 +55,8 @@ class CodexAgent(BaseAgent):if not os.path.exists(request.working_path):os.makedirs(request.working_path, exist_ok=True)- # Read channel-level configuration overrides- channel_settings = self.settings_manager.get_channel_settings(request.context.channel_id)+ # Read configuration overrides using settings_key (user_id for DM, channel_id for channels)+ channel_settings = self.settings_manager.get_channel_settings(request.settings_key)routing = channel_settings.routing if channel_settings else None# Priority: channel config > global defaultdiff --git a/modules/im/discord.py b/modules/im/discord.pyindex ec4aff259..91c6789a0 100644--- a/modules/im/discord.py+++ b/modules/im/discord.py@@ -603,6 +603,7 @@ class DiscordBot(BaseIMClient):current_require_mention: object = None,global_require_mention: bool = False,current_language: str = None,+ owner_user_id: Optional[str] = None,):interaction = trigger_id if isinstance(trigger_id, discord.Interaction) else None@@ -739,10 +740,25 @@ class DiscordBot(BaseIMClient):async def on_timeout(self) -> None:return- owner_id = str(interaction.user.id) if interaction else None+ owner_id = owner_user_id or (str(interaction.user.id) if interaction else None)view = SettingsView(self, owner_id)async def save_callback(save_interaction: discord.Interaction):+ # Re-check auth before saving (defense-in-depth against shared views)+ save_uid = str(save_interaction.user.id)+ save_cid = channel_id or str(save_interaction.channel_id or "")+ save_is_dm = save_interaction.guild is None+ auth = check_auth(+ user_id=save_uid,+ channel_id=save_cid,+ is_dm=save_is_dm,+ action="settings",+ store=self.settings_manager.store if self.settings_manager else None,+ )+ if not auth.allowed:+ await self._send_auth_denial(save_cid, save_uid, auth, interaction=save_interaction)+ return+show_types = list(view.selected_types or [])require_value = view.require_valueif require_value == "__default__":diff --git a/vibe/api.py b/vibe/api.pyindex b2e458eeb..edfe49fc2 100644--- a/vibe/api.py+++ b/vibe/api.py@@ -1125,6 +1125,8 @@ def save_users(payload: dict) -> dict:for user_id, up in (payload.get("users") or {}).items():if not isinstance(up, dict):continue+ # Preserve dm_chat_id from existing user (not editable via UI)+ existing = store.settings.users.get(user_id)users[user_id] = UserSettings(display_name=up.get("display_name", ""),is_admin=up.get("is_admin", False),@@ -1133,6 +1135,7 @@ def save_users(payload: dict) -> dict:show_message_types=normalize_show_message_types(up.get("show_message_types")),custom_cwd=up.get("custom_cwd"),routing=_parse_routing(up.get("routing") or {}),+ dm_chat_id=existing.dm_chat_id if existing else "",)# Enforce admin invariant: if admins existed before, at least one must remain