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: Fix Slack markdown formatting and button functionality
cyhhaofad63124452f
diff --git a/core/controller.py b/core/controller.pyindex 00320d535..e8b059977 100644--- a/core/controller.py+++ b/core/controller.py@@ -768,9 +768,10 @@ Use the buttons below to manage your Claude Code sessions, or simply type any me_Tip: All commands work in DMs, channels, and threads!_"""- parse_mode = 'Markdown' if self.config.platform == "telegram" else 'markdown'- await self.im_client.send_message(context, info_text, parse_mode=parse_mode)- return+ # Send the info message for either info button+ parse_mode = 'Markdown' if self.config.platform == "telegram" else 'markdown'+ await self.im_client.send_message(context, info_text, parse_mode=parse_mode)+ return# Handle settings toggle buttons (existing functionality)if callback_data.startswith("toggle_msg_"):diff --git a/modules/im/slack.py b/modules/im/slack.pyindex 438647013..46239575d 100644--- a/modules/im/slack.py+++ b/modules/im/slack.py@@ -45,6 +45,35 @@ class SlackBot(BaseIMClient):app_token=self.config.app_token,web_client=self.web_client)++ def _convert_markdown_to_slack_mrkdwn(self, text: str) -> str:+ """Convert standard markdown to Slack mrkdwn format++ Main differences:+ - Bold: ** to *+ - Italic: * to _+ - No need to escape parentheses+ """+ import re++ # Strategy: First handle italic (single *), then bold (double **)+ # This prevents the bold conversion from affecting italic markers++ # Step 1: Temporarily replace single asterisks with a placeholder for italic+ # Match single * that are not preceded or followed by another *+ text = re.sub(r'(?<!\*)\*(?!\*)([^*]+?)(?<!\*)\*(?!\*)', r'ITALIC_START\1ITALIC_END', text)++ # Step 2: Convert bold (**text** to *text*)+ text = re.sub(r'\*\*(.+?)\*\*', r'*\1*', text)++ # Step 3: Convert the italic placeholders to underscores+ text = text.replace('ITALIC_START', '_').replace('ITALIC_END', '_')++ # Remove unnecessary escaping of parentheses and dots+ text = text.replace(r'\(', '(').replace(r'\)', ')')+ text = text.replace(r'\.', '.')++ return textasync def send_message(self, context: MessageContext, text: str,parse_mode: Optional[str] = None,@@ -52,6 +81,10 @@ class SlackBot(BaseIMClient):"""Send a message to Slack"""self._ensure_clients()try:+ # Convert markdown to Slack mrkdwn if needed+ if parse_mode == 'markdown':+ text = self._convert_markdown_to_slack_mrkdwn(text)+# Prepare message kwargskwargs = {'channel': context.channel_id,@@ -87,6 +120,10 @@ class SlackBot(BaseIMClient):"""Send a message with interactive buttons"""self._ensure_clients()try:+ # Convert markdown to Slack mrkdwn if needed+ if parse_mode == 'markdown':+ text = self._convert_markdown_to_slack_mrkdwn(text)+# Convert our generic keyboard to Slack blocksblocks = [{