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(feishu): strip file links from log messages

cyh04d36a865e12
diff --git a/core/message_dispatcher.py b/core/message_dispatcher.py
index 1b3ddc456..0e29ad982 100644
--- a/core/message_dispatcher.py
+++ b/core/message_dispatcher.py
@@ -383,11 +383,20 @@ class ConsolidatedMessageDispatcher:
)
return None
+ reply_enhancements_on = getattr(self.controller.config, "reply_enhancements", True)
+ if reply_enhancements_on:
+ enhanced = process_reply(text)
+ chunk = enhanced.text.strip()
+ else:
+ chunk = text.strip()
+
+ if not chunk:
+ return None
+
consolidated_key = self._get_consolidated_message_key(context)
lock = self._get_consolidated_message_lock(consolidated_key)
async with lock:
- chunk = text.strip()
max_bytes = self._get_consolidated_max_bytes(context)
split_threshold = self._get_consolidated_split_threshold(context)
existing = self._consolidated_message_buffers.get(consolidated_key, "")
diff --git a/tests/test_reply_enhancer_platform.py b/tests/test_reply_enhancer_platform.py
index 4b315f1cf..4d983fb0d 100644
--- a/tests/test_reply_enhancer_platform.py
+++ b/tests/test_reply_enhancer_platform.py
@@ -221,6 +221,22 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
keyboard = controller.im_client.sent_button_messages[0][3]
self.assertEqual([[button.text for button in row] for row in keyboard.buttons], [["继续"], ["提交PR"]])
+ async def test_lark_log_message_strips_file_links_before_sending(self):
+ controller = _StubController("lark")
+ dispatcher = ConsolidatedMessageDispatcher(controller)
+ context = MessageContext(user_id="U1", channel_id="C1", platform="lark")
+
+ await dispatcher.emit_agent_message(
+ context,
+ "assistant",
+ "Preview ready\n\n![screen](file:///tmp/screen-room.png)",
+ )
+
+ self.assertEqual(
+ controller.im_client.sent_messages,
+ [("C1", "Preview ready\n\nscreen", "markdown")],
+ )
+
async def test_telegram_quick_reply_buttons_use_vertical_layout(self):
controller = _StubController("telegram")
dispatcher = ConsolidatedMessageDispatcher(controller)