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(reply): address review findings — parsing crash, path security, button guard
cyhd72bf1c4e90b
diff --git a/core/message_dispatcher.py b/core/message_dispatcher.pyindex ed5a84d60..29227276d 100644--- a/core/message_dispatcher.py+++ b/core/message_dispatcher.py@@ -148,7 +148,7 @@ class ConsolidatedMessageDispatcher:reply_enhancements_on = getattr(self.controller.config, "reply_enhancements", True)if reply_enhancements_on:enhanced = process_reply(text)- display_text = enhanced.text or text+ display_text = enhanced.text if enhanced.text.strip() else textelse:enhanced = Nonedisplay_text = text@@ -342,19 +342,35 @@ class ConsolidatedMessageDispatcher:) -> None:"""Upload local files referenced by ``file://`` links."""import os+ from pathlib import Pathif not hasattr(im_client, "upload_file_from_path"):logger.debug("IM client does not support upload_file_from_path; skipping file uploads")return+ # Determine allowed roots for file uploads (cwd + /tmp)+ allowed_roots: list[Path] = [Path("/tmp")]+ cwd = getattr(self.controller.config, "runtime", None)+ if cwd and hasattr(cwd, "default_cwd"):+ allowed_roots.append(Path(cwd.default_cwd).resolve())+for fl in files:if not os.path.isfile(fl.path):logger.warning("File not found, skipping upload: %s", fl.path)continue+ # Security: resolve symlinks and ensure within allowed roots+ try:+ resolved = Path(fl.path).resolve(strict=True)+ except (OSError, ValueError):+ logger.warning("Cannot resolve file path, skipping: %s", fl.path)+ continue+ if not any(resolved == root or resolved.is_relative_to(root) for root in allowed_roots):+ logger.warning("File outside allowed roots, skipping: %s", fl.path)+ continuetry:await im_client.upload_file_from_path(context,- file_path=fl.path,+ file_path=str(resolved),title=fl.label or os.path.basename(fl.path),)except Exception as err:diff --git a/core/reply_enhancer.py b/core/reply_enhancer.pyindex 0c5227383..e3a4a32e8 100644--- a/core/reply_enhancer.py+++ b/core/reply_enhancer.py@@ -128,7 +128,7 @@ def _extract_buttons(text: str) -> Tuple[List[QuickReplyButton], str]:block = m.group(1)buttons: List[QuickReplyButton] = []- for (label,) in _BUTTON_TOKEN_RE.findall(block):+ for label in _BUTTON_TOKEN_RE.findall(block):label = label.strip()if label:buttons.append(QuickReplyButton(text=label))@@ -136,6 +136,9 @@ def _extract_buttons(text: str) -> Tuple[List[QuickReplyButton], str]:if not buttons:return [], text+ # Enforce a reasonable upper bound on button count+ buttons = buttons[:5]+cleaned = text[: m.start()]return buttons, cleaned