diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index 8e061f831..3a6ec2441 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -370,6 +370,32 @@ PLATFORM_HINTS = { "MEDIA:/absolute/path/to/file in your response. Images (.jpg, .png, " ".heic) appear as photos and other files arrive as attachments." ), + "mattermost": ( + "You are in a Mattermost workspace communicating with your user. " + "Mattermost renders standard Markdown — headings, bold, italic, code " + "blocks, and tables all work. " + "You can send media files natively: include MEDIA:/absolute/path/to/file " + "in your response. Images (.jpg, .png, .webp) are uploaded as photo " + "attachments, audio and video as file attachments. " + "Image URLs in markdown format ![alt](url) are rendered as inline previews automatically." + ), + "matrix": ( + "You are in a Matrix room communicating with your user. " + "Matrix renders Markdown — bold, italic, code blocks, and links work; " + "the adapter converts your Markdown to HTML for rich display. " + "You can send media files natively: include MEDIA:/absolute/path/to/file " + "in your response. Images (.jpg, .png, .webp) are sent as inline photos, " + "audio (.ogg, .mp3) as voice/audio messages, video (.mp4) inline, " + "and other files as downloadable attachments." + ), + "feishu": ( + "You are in a Feishu (Lark) workspace communicating with your user. " + "Feishu renders Markdown in messages — bold, italic, code blocks, and " + "links are supported. " + "You can send media files natively: include MEDIA:/absolute/path/to/file " + "in your response. Images (.jpg, .png, .webp) are uploaded and displayed " + "inline, audio files as voice messages, and other files as attachments." + ), "weixin": ( "You are on Weixin/WeChat. Markdown formatting is supported, so you may use it when " "it improves readability, but keep the message compact and chat-friendly. You can send media files natively: " diff --git a/tests/agent/test_prompt_builder.py b/tests/agent/test_prompt_builder.py index 11712b951..88de5186b 100644 --- a/tests/agent/test_prompt_builder.py +++ b/tests/agent/test_prompt_builder.py @@ -807,6 +807,24 @@ class TestPromptBuilderConstants: # check that this test is calibrated correctly). assert "include MEDIA:" in PLATFORM_HINTS["telegram"] + def test_platform_hints_mattermost(self): + hint = PLATFORM_HINTS["mattermost"] + assert "Mattermost" in hint + assert "MEDIA:" in hint + assert "Markdown" in hint + + def test_platform_hints_matrix(self): + hint = PLATFORM_HINTS["matrix"] + assert "Matrix" in hint + assert "MEDIA:" in hint + assert "Markdown" in hint + + def test_platform_hints_feishu(self): + hint = PLATFORM_HINTS["feishu"] + assert "Feishu" in hint + assert "MEDIA:" in hint + assert "Markdown" in hint + # ========================================================================= # Environment hints