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(core): restrict link quick reply targets

cyh7457afdbdeb5
diff --git a/core/reply_enhancer.py b/core/reply_enhancer.py
index a6ad560ea..a23de08e6 100644
--- a/core/reply_enhancer.py
+++ b/core/reply_enhancer.py
@@ -69,12 +69,12 @@ _FILE_LINK_RE = re.compile(r"(!?)\[([^\]]*)\]\((file://(?:[^()]+|\([^)]*\))+)\)"
# link-formatted buttons separated by ``|`` or full-width ``|``.
_BUTTON_BLOCK_RE = re.compile(
r"\n-{3,}\s*\n" # --- separator line
- r"((?:\s*(?:\[[^\]]+\](?:\(<[^)>\n]+>\)|\([^)>\n]+\))?|<[^|>\n]+\|[^>\n]+>)\s*(?:[||]\s*)?)+)" # button tokens
+ r"((?:\s*(?:\[[^\]]+\](?:\(<https?://[^)>\n]+>\))?|<https?://[^|>\n]+\|[^>\n]+>)\s*(?:[||]\s*)?)+)" # button tokens
r"\s*$", # trailing whitespace / end of string
)
# Individual button tokens: [button text], [button text](<url>), or Slack-style <url|button text>.
-_BUTTON_TOKEN_RE = re.compile(r"\[([^\]]+)\](?:\(<[^)>\n]+>\)|\([^)>\n]+\))?|<[^|>\n]+\|([^>\n]+)>")
+_BUTTON_TOKEN_RE = re.compile(r"\[([^\]]+)\](?:\(<https?://[^)>\n]+>\))?|<https?://[^|>\n]+\|([^>\n]+)>")
# Silent output blocks are intentionally simple and model-facing. They are
# stripped before any reply enhancement parsing so hidden text cannot create
diff --git a/tests/test_reply_enhancer_platform.py b/tests/test_reply_enhancer_platform.py
index 61dd23cf5..c50aee9b2 100644
--- a/tests/test_reply_enhancer_platform.py
+++ b/tests/test_reply_enhancer_platform.py
@@ -159,6 +159,13 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(reply.text, text)
self.assertEqual(reply.buttons, [])
+ def test_process_reply_preserves_plain_markdown_reference_link_block(self):
+ text = "Done.\n\n---\n[Release notes](https://example.com)"
+ reply = process_reply(text)
+
+ self.assertEqual(reply.text, text)
+ self.assertEqual(reply.buttons, [])
+
def test_prompt_includes_task_watch_and_hook_usage_with_thread_default_session_key(self):
context = MessageContext(
user_id="U1",