The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(platforms): plugin PlatformEntry carries its prompt hint and display defaults
Teknium3d21ec1294ae
diff --git a/agent/prompt_builder.py b/agent/prompt_builder.pyindex a2baa531d40..1936663609d 100644--- a/agent/prompt_builder.py+++ b/agent/prompt_builder.py@@ -661,10 +661,6 @@ def hud_surface_note(valid_tool_names: set[str] | None = None,# swapped at the API boundary in _build_api_kwargs().DEVELOPER_ROLE_MODELS = ("gpt-5", "codex")-_MEDIA_NATIVE = (- "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "-)-_LOCAL_CRON_DELIVERY_NOTE = ("Cron jobs scheduled from this session are LOCAL-ONLY: their output is saved (viewable via cronjob ""action='list') but is NOT delivered back into this session — there is no live-delivery channel here. If "@@ -673,53 +669,9 @@ _LOCAL_CRON_DELIVERY_NOTE = ("default-deliver cron job will message them in this session.")+# Hints for core surfaces only. A messaging platform's hint ships with its plugin+# (``PlatformEntry.platform_hint``, read by agent/system_prompt._default_platform_hint).PLATFORM_HINTS = {- "whatsapp": (- "You are on WhatsApp. Standard markdown auto-converts to WhatsApp syntax (*bold*, _italic_, ~strike~, "- "monospace) \u2014 write markdown freely, bullets included. No tables \u2014 use bullets or labeled lines. "- f"{_MEDIA_NATIVE}Images (.jpg, .png, .webp) send as photos, videos (.mp4, .mov) play "- "inline, other files arrive as documents; image URLs via  send as photos."- ),- "whatsapp_cloud": (- "You are on WhatsApp (Meta Business Cloud API). Standard markdown auto-converts to WhatsApp syntax "- "\u2014 write markdown freely. No tables \u2014 use bullets or labeled lines. "- f"{_MEDIA_NATIVE}Images (.jpg, .png) send as photos, videos (.mp4) inline, audio as voice/audio, other files as "- "documents;  works. NOTE: Meta refuses free-form replies when the user hasn't messaged in "- "24h (error 131047) \u2014 relevant only for delayed/scheduled sends."- ),- "telegram": (- "You are on Telegram. Standard Markdown auto-converts: **bold**, "- "*italic*, ~~strikethrough~~, ||spoiler||, `code`, ```blocks```, "- "[links](url), ## headers. Prefer bullets or labeled lines for structured data (no tables). "- f"{_MEDIA_NATIVE}Images (.png, .jpg, .webp) send as photos, videos (.mp4) play inline; image URLs via  send as "- "photos. Audio: add [[audio_as_voice]] on its own line to send ANY audio file as a native voice bubble "- "(non-Opus transcodes automatically); without it, .mp3/.m4a arrive as audio files, other formats as documents."- ),- "discord": (- "You are in a Discord server or group chat communicating with your user. Discord renders standard "- "markdown natively (bold, italic, code blocks, links); tables are NOT supported — use bullet lists "- "or labeled lines. You can send media files natively: include MEDIA:/absolute/path/to/file in your "- "response. Images (.png, .jpg, .webp) are sent as photo attachments, audio as file attachments. You "- "can also include image URLs in markdown format  and they will be sent as attachments."- ),- "slack": (- "You are in a Slack workspace communicating with your user. Standard markdown is auto-converted to Slack "- "formatting (bold, headers, links, code); tables are NOT supported — use bullet lists or labeled lines. You "- "can send media files natively: include MEDIA:/absolute/path/to/file in your response. Images (.png, .jpg, "- ".webp) are uploaded as photo attachments, audio as file attachments. You can also include image URLs in "- "markdown format  and they will be uploaded as attachments."- ),- "signal": (- "You are on Signal. Standard markdown (**bold**, *italic*, ~~strike~~, # headers, `code`) auto-converts to "- "Signal formatting; bullets render as \u2022. No tables \u2014 use bullets or labeled lines. "- f"{_MEDIA_NATIVE}Images (.png, .jpg, .webp) send as photos, other files as documents;  sends as photos."- ),- "email": (- "You are communicating via email. Write clear, well-structured responses suitable for email. Use "- "plain text formatting (no markdown). Keep responses concise but complete. You can send file "- "attachments — include MEDIA:/absolute/path/to/file in your response. The subject line is preserved "- "for threading. Do not include greetings or sign-offs unless contextually appropriate."- ),"cron": ("You are running as a scheduled cron job. There is no user present — you cannot ask questions, ""request clarification, or wait for follow-up. Execute the task fully and autonomously, making "@@ -760,69 +712,6 @@ PLATFORM_HINTS = {"window.hermes.send(\"prompt\")) sends that prompt as a hidden user turn — answer it by updating the widget's ""file, not with prose."),- "sms": (- "You are communicating via SMS. Keep responses concise and use plain text only — no markdown, no "- "formatting. SMS messages are limited to ~1600 characters, so be brief and direct."- ),- "bluebubbles": (- # The adapter runs strip_markdown(keep_link_targets=True): markers vanish, the layout stays.- "You are texting via iMessage (BlueBubbles). Replies arrive as plain text bubbles, so write like a person "- "texting: short and conversational, answer first, no preamble or recap. Markdown does not render and is "- "stripped, so skip headers, tables, code fences and backticks; for a few items use short lines or a "- "sentence rather than nested bullets. Put a command or code snippet on its own line as plain text so it "- "can be copied. Write links as bare URLs (iMessage auto-links them). "- f"{_MEDIA_NATIVE}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 "- " are rendered as inline previews automatically."- ),- "matrix": (- "You are in a Matrix room. Your markdown converts to HTML \u2014 bold, italic, code, headings, lists, "- "blockquotes, and links render. Do NOT use tables (popular clients like Element X collapse them into run-on "- "text \u2014 use '**Label:** value' lines or bullets), and avoid ||spoilers||, ~~strikethrough~~, and "- "checkboxes (they appear as literal characters). Prefer [descriptive text](url) over bare URLs. "- f"{_MEDIA_NATIVE}Images send as inline photos, audio (.ogg, .mp3) as voice/audio "- "messages, video (.mp4) inline, other files as 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 native voice messages (non-Opus formats are transcoded "- "automatically; without ffmpeg they fall back to file attachments), 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: include "- "MEDIA:/absolute/path/to/file in your response. Images are sent as native photos, videos play inline when "- "supported, and other files arrive as downloadable documents. You can also include image URLs in markdown "- "format  and they will be downloaded and sent as native media when possible."- ),- "wecom": (- "You are on WeCom (\u4f01\u4e1a\u5fae\u4fe1). Markdown is supported. "- f"{_MEDIA_NATIVE}Images (.jpg, .png, .webp) send as photos (\u226410 MB), other files as documents (\u226420 MB), videos "- "(.mp4) play inline. Voice messages must be AMR \u2014 other audio formats send as file attachments. Image "- "URLs via  are downloaded and sent as photos. Never claim you lack file-sending."- ),- "qqbot": (- "You are on QQ, a popular Chinese messaging platform. QQ supports markdown formatting "- "and emoji. You can send media files natively: include MEDIA:/absolute/path/to/file in "- "your response. Images are sent as native photos, and other files arrive as downloadable documents."- ),- "yuanbao": (- "You are on Yuanbao (\u817e\u8baf\u5143\u5b9d), a Chinese AI assistant "- "platform. Markdown renders (code blocks, tables, bold/italic). "- f"{_MEDIA_NATIVE}Images (.jpg, .png, .webp, .gif) send as photos, other files as downloadable documents (max 50 MB); "- "image URLs via  are downloaded and sent as photos. Never claim you lack file-sending. "- "Stickers (\u8d34\u7eb8/\u8868\u60c5\u5305): when the user sends one (you see '[emoji: "- "\u540d\u79f0]') or asks for one, use the sticker tools \u2014 yb_search_sticker with a Chinese "- "keyword, then yb_send_sticker with the chosen id \u2014 which send a real native sticker. Never "- "draw sticker-like PNGs and send them as images, and bare Unicode emoji is not a substitute."- ),"api_server": ("You're responding through an API server. The rendering layer is unknown — assume plain text. No markdown ""formatting (no asterisks, bullets, headers, code fences). Treat this like a conversation, not a document. "diff --git a/gateway/display_config.py b/gateway/display_config.pyindex 72981b4f8b5..416b4a63ab7 100644--- a/gateway/display_config.py+++ b/gateway/display_config.py@@ -2,7 +2,7 @@Resolution order, first non-None wins: ``display.platforms.<platform>.<key>`` →``display.<key>`` → ``_PLATFORM_DEFAULTS[platform][key]`` (a plugin platform: its registered-``display_tier``) → ``_GLOBAL_DEFAULTS[key]``.+``display_tier`` + ``display_overrides``) → ``_GLOBAL_DEFAULTS[key]``.Exception: ``display.streaming`` is CLI-only; gateway streaming follows the top-level``streaming`` config unless a per-platform override sets it. Legacy``display.tool_progress_overrides`` is still read as a ``tool_progress`` fallback.@@ -48,29 +48,9 @@ _TIER_LOW = {}_TIER_MINIMAL = {**_TIER_LOW, "tool_preview_length": 0}+# Core-only surfaces. A plugin platform declares ``display_tier`` (+ optional ``display_overrides``)+# on its ``PlatformEntry``; _platform_defaults() reads it from the registry._PLATFORM_DEFAULTS: dict[str, dict[str, Any]] = {- # Mobile inbox: quiet tool_progress / busy-ack, but keep interim commentary and heartbeats so it- # doesn't look like "typing..." for 30 minutes.- "telegram": {**_TIER_HIGH, "tool_progress": "off", "busy_ack_detail": False},- "discord": {**_TIER_HIGH, "reasoning_style": "subtext"}, # "-# " subtext reads as metadata- # Slack: Bolt posts cannot be edited like CLI; "new"/"all" spam permanent lines.- "slack": {**_TIER_MEDIUM, "tool_progress": "off", "long_running_notifications": False, "busy_ack_detail": False},- "mattermost": _TIER_MEDIUM,- "matrix": _TIER_MEDIUM,- "feishu": _TIER_MEDIUM,- "buzz": _TIER_MEDIUM, # Nostr: edits in place but channels are shared community spaces- "signal": _TIER_LOW,- "whatsapp": _TIER_MEDIUM, # Baileys bridge supports /edit- "whatsapp_cloud": _TIER_LOW, # adapter lacks edit_message; promote once it lands- "photon": _TIER_LOW, # permanent-message iMessage inboxes (no edit)- "bluebubbles": _TIER_LOW,- "weixin": _TIER_LOW,- # Non-editable, but its native "stream" msgtype gives a typing animation + cumulative updates.- "wecom": {**_TIER_LOW, "streaming": True},- "wecom_callback": _TIER_LOW,- "dingtalk": _TIER_LOW,- "email": _TIER_MINIMAL,- "sms": _TIER_MINIMAL,"webhook": _TIER_MINIMAL,"api_server": {**_TIER_HIGH, "tool_preview_length": 0},}@@ -80,7 +60,7 @@ _TIERS = {"high": _TIER_HIGH, "medium": _TIER_MEDIUM, "low": _TIER_LOW, "minimaldef _platform_defaults(platform_key: str) -> dict[str, Any]:"""Built-in defaults for *platform_key*: the table above, else the ``display_tier`` a plugin- platform registered (``PlatformEntry.display_tier``)."""+ platform registered (``PlatformEntry.display_tier``) with its ``display_overrides`` on top."""if platform_key in _PLATFORM_DEFAULTS:return _PLATFORM_DEFAULTS[platform_key]try:@@ -88,7 +68,9 @@ def _platform_defaults(platform_key: str) -> dict[str, Any]:entry = platform_registry.get(platform_key)except Exception:return {}- return _TIERS.get(str(getattr(entry, "display_tier", "") or "").lower(), {})+ tier = _TIERS.get(str(getattr(entry, "display_tier", "") or "").lower(), {})+ overrides = getattr(entry, "display_overrides", None)+ return {**tier, **overrides} if overrides else tier# Canonical set of per-platform overrideable keys (for validation).diff --git a/gateway/platform_registry.py b/gateway/platform_registry.pyindex d4f08d51921..197ce49662b 100644--- a/gateway/platform_registry.py+++ b/gateway/platform_registry.py@@ -115,6 +115,10 @@ class PlatformEntry:# Built-in display defaults tier ("high" | "medium" | "low" | "minimal", see# gateway/display_config.py) used below the user's display.* overrides; "" = global defaults.display_tier: str = ""+ # --- prompt ---+ # Per-key display defaults layered over ``display_tier`` (e.g. Discord ``reasoning_style``);+ # empty = the tier as-is. Same keys as display_config._GLOBAL_DEFAULTS.+ display_overrides: dict = field(default_factory=dict)# Env prefixes shared with a non-channel capability (the same plugin's tools): profile clones# strip keys under them only when the source profile runs the adapter (profile_channels.py).shared_env_prefixes: tuple = ()diff --git a/plugins/platforms/bluebubbles/adapter.py b/plugins/platforms/bluebubbles/adapter.pyindex e76766dc467..90440365ffc 100644--- a/plugins/platforms/bluebubbles/adapter.py+++ b/plugins/platforms/bluebubbles/adapter.py@@ -685,6 +685,19 @@ def interactive_setup() -> None:" Install: https://docs.bluebubbles.app/helper-bundle/installation")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ # The adapter runs strip_markdown(keep_link_targets=True): markers vanish, the layout stays.+ "You are texting via iMessage (BlueBubbles). Replies arrive as plain text bubbles, so write like a person "+ "texting: short and conversational, answer first, no preamble or recap. Markdown does not render and is "+ "stripped, so skip headers, tables, code fences and backticks; for a few items use short lines or a "+ "sentence rather than nested bullets. Put a command or code snippet on its own line as plain text so it "+ "can be copied. Write links as bare URLs (iMessage auto-links them). "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.jpg, .png, .heic) appear as photos and other files arrive as attachments."+)++def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""ctx.register_platform(@@ -698,4 +711,7 @@ def register(ctx) -> None:standalone_sender_fn=_standalone_send, # out-of-process cron / send_message# 0 = send_message does not pre-chunk: the adapter's send() splits per paragraph and# truncates itself (MAX_MESSAGE_LENGTH), exactly as the former core sender did.- max_message_length=0, pii_safe=True, emoji="💬", allow_update_command=True)+ max_message_length=0, pii_safe=True, emoji="💬", allow_update_command=True,+ platform_hint=_PLATFORM_HINT,+ display_tier="low",+ )diff --git a/plugins/platforms/buzz/adapter.py b/plugins/platforms/buzz/adapter.pyindex 739368dec9f..042ca1dd7d6 100644--- a/plugins/platforms/buzz/adapter.py+++ b/plugins/platforms/buzz/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's _PLATFORM_DEFAULTS row for this platform moved onto its register() call as display_tier; the growth is only that kwarg"""Buzz platform adapter (Block's Nostr-based human+agent community relay).Outbound and polling go through the ``buzz`` CLI ("JSON in, JSON out", never a shell);@@ -2019,4 +2020,6 @@ def register(ctx):"by @-mentioning your name or npub in channels; direct messages ""reach you without a mention. Keep responses conversational."),+ # Nostr: edits in place but channels are shared community spaces.+ display_tier="medium",)diff --git a/plugins/platforms/dingtalk/adapter.py b/plugins/platforms/dingtalk/adapter.pyindex f595a58d94e..dc616004c87 100644--- a/plugins/platforms/dingtalk/adapter.py+++ b/plugins/platforms/dingtalk/adapter.py@@ -855,4 +855,5 @@ def register(ctx) -> None:setup_fn=interactive_setup, apply_yaml_config_fn=_apply_yaml_config, allowed_users_env="DINGTALK_ALLOWED_USERS",allow_all_env="DINGTALK_ALLOW_ALL_USERS", cron_deliver_env_var="DINGTALK_HOME_CHANNEL",standalone_sender_fn=_standalone_send, emoji="🐳", allow_update_command=True,+ display_tier="low",)diff --git a/plugins/platforms/discord/adapter.py b/plugins/platforms/discord/adapter.pyindex 51fa8798d7b..0bd974c5a51 100644--- a/plugins/platforms/discord/adapter.py+++ b/plugins/platforms/discord/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's PLATFORM_HINTS/_PLATFORM_DEFAULTS rows for this platform moved onto its register() call (hint text lives in adapter_hint.py); the growth is only those kwargsfrom __future__ import annotations"""@@ -7373,9 +7374,9 @@ def _apply_yaml_config(yaml_cfg: dict, discord_cfg: dict) -> dict | None:_is_connected = _env_is_connected("DISCORD_BOT_TOKEN")-def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""+ from plugins.platforms.discord.adapter_hint import PLATFORM_HINTfrom plugins.platforms.discord.onboarding import interactive_setupctx.register_platform(@@ -7404,4 +7405,8 @@ def register(ctx) -> None:max_message_length=2000,emoji="🎮",allow_update_command=True,+ platform_hint=PLATFORM_HINT,+ display_tier="high",+ # "-# " subtext reads as metadata.+ display_overrides={"reasoning_style": "subtext"},)diff --git a/plugins/platforms/discord/adapter_hint.py b/plugins/platforms/discord/adapter_hint.pynew file mode 100644index 00000000000..7e0514c2aab--- /dev/null+++ b/plugins/platforms/discord/adapter_hint.py@@ -0,0 +1,12 @@+"""Discord system-prompt platform hint (``PlatformEntry.platform_hint``), kept out of the adapter facade.++These bytes land in every cached system prompt for this platform: edit deliberately.+"""++PLATFORM_HINT = (+ "You are in a Discord server or group chat communicating with your user. Discord renders standard "+ "markdown natively (bold, italic, code blocks, links); tables are NOT supported — use bullet lists "+ "or labeled lines. You can send media files natively: include MEDIA:/absolute/path/to/file in your "+ "response. Images (.png, .jpg, .webp) are sent as photo attachments, audio as file attachments. You "+ "can also include image URLs in markdown format  and they will be sent as attachments."+)diff --git a/plugins/platforms/email/adapter.py b/plugins/platforms/email/adapter.pyindex d983fd81c79..34a0797446f 100644--- a/plugins/platforms/email/adapter.py+++ b/plugins/platforms/email/adapter.py@@ -996,6 +996,14 @@ def _is_connected(config) -> bool:return bool((gateway_mod.get_env_value("EMAIL_ADDRESS") or "").strip())+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are communicating via email. Write clear, well-structured responses suitable for email. Use "+ "plain text formatting (no markdown). Keep responses concise but complete. You can send file "+ "attachments — include MEDIA:/absolute/path/to/file in your response. The subject line is preserved "+ "for threading. Do not include greetings or sign-offs unless contextually appropriate."+)+def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""@@ -1004,4 +1012,7 @@ def register(ctx) -> None:required_env=["EMAIL_ADDRESS", "EMAIL_PASSWORD", "EMAIL_SMTP_HOST"],install_hint="Email uses the Python stdlib (smtplib/imaplib) — no extra deps", allowed_users_env="EMAIL_ALLOWED_USERS",allow_all_env="EMAIL_ALLOW_ALL_USERS", cron_deliver_env_var="EMAIL_HOME_ADDRESS", standalone_sender_fn=_standalone_send,- max_message_length=50_000, pii_safe=True, emoji="📧", allow_update_command=True)+ max_message_length=50_000, pii_safe=True, emoji="📧", allow_update_command=True,+ platform_hint=_PLATFORM_HINT,+ display_tier="minimal",+ )diff --git a/plugins/platforms/feishu/adapter.py b/plugins/platforms/feishu/adapter.pyindex c168581b824..a7d512333d5 100644--- a/plugins/platforms/feishu/adapter.py+++ b/plugins/platforms/feishu/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's PLATFORM_HINTS/_PLATFORM_DEFAULTS rows for this platform moved onto its register() call (hint text lives in adapter_hint.py); the growth is only those kwargs"""Feishu/Lark platform adapter.@@ -4476,9 +4477,9 @@ def _is_connected(config) -> bool:return bool(extra.get("app_id"))-def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""+ from plugins.platforms.feishu.adapter_hint import PLATFORM_HINTctx.register_platform(name="feishu", label="Feishu / Lark", adapter_factory=FeishuAdapter,check_fn=feishu_deps_present, ensure_deps_fn=check_feishu_requirements,@@ -4490,4 +4491,6 @@ def register(ctx) -> None:standalone_sender_fn=_standalone_send, max_message_length=8000, emoji="🪽",allow_update_command=True,allow_bots_env="FEISHU_ALLOW_BOTS",+ platform_hint=PLATFORM_HINT,+ display_tier="medium",)diff --git a/plugins/platforms/feishu/adapter_hint.py b/plugins/platforms/feishu/adapter_hint.pynew file mode 100644index 00000000000..58d75879e31--- /dev/null+++ b/plugins/platforms/feishu/adapter_hint.py@@ -0,0 +1,12 @@+"""Feishu system-prompt platform hint (``PlatformEntry.platform_hint``), kept out of the adapter facade.++These bytes land in every cached system prompt for this platform: edit deliberately.+"""++PLATFORM_HINT = (+ "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 native voice messages (non-Opus formats are transcoded "+ "automatically; without ffmpeg they fall back to file attachments), and other files as attachments."+)diff --git a/plugins/platforms/matrix/adapter.py b/plugins/platforms/matrix/adapter.pyindex 57368d728a0..e8ae89a256c 100644--- a/plugins/platforms/matrix/adapter.py+++ b/plugins/platforms/matrix/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's PLATFORM_HINTS/_PLATFORM_DEFAULTS rows for this platform moved onto its register() call (hint text lives in adapter_hint.py); the growth is only those kwargs"""Matrix gateway adapter (any homeserver, via mautrix; optional E2EE with ``mautrix[encryption]``).Env vars (config.yaml ``matrix:`` keys alias several — env wins):@@ -3255,8 +3256,8 @@ def _is_connected(config) -> bool:return bool(str(homeserver).strip() and str(token).strip())-def register(ctx) -> None:+ from plugins.platforms.matrix.adapter_hint import PLATFORM_HINTctx.register_platform(name="matrix", label="Matrix", adapter_factory=MatrixAdapter, check_fn=matrix_deps_present,ensure_deps_fn=ensure_matrix_deps, is_connected=_is_connected,@@ -3264,4 +3265,7 @@ def register(ctx) -> None:setup_fn=interactive_setup, apply_yaml_config_fn=_apply_yaml_config, allowed_users_env="MATRIX_ALLOWED_USERS",allow_all_env="MATRIX_ALLOW_ALL_USERS", cron_deliver_env_var="MATRIX_HOME_ROOM",standalone_sender_fn=_standalone_send, max_message_length=DEFAULT_MAX_MESSAGE_LENGTH, emoji="🔐",- allow_update_command=True)+ allow_update_command=True,+ platform_hint=PLATFORM_HINT,+ display_tier="medium",+ )diff --git a/plugins/platforms/matrix/adapter_hint.py b/plugins/platforms/matrix/adapter_hint.pynew file mode 100644index 00000000000..f7329ec15d0--- /dev/null+++ b/plugins/platforms/matrix/adapter_hint.py@@ -0,0 +1,14 @@+"""Matrix system-prompt platform hint (``PlatformEntry.platform_hint``), kept out of the adapter facade.++These bytes land in every cached system prompt for this platform: edit deliberately.+"""++PLATFORM_HINT = (+ "You are in a Matrix room. Your markdown converts to HTML \u2014 bold, italic, code, headings, lists, "+ "blockquotes, and links render. Do NOT use tables (popular clients like Element X collapse them into run-on "+ "text \u2014 use '**Label:** value' lines or bullets), and avoid ||spoilers||, ~~strikethrough~~, and "+ "checkboxes (they appear as literal characters). Prefer [descriptive text](url) over bare URLs. "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images send as inline photos, audio (.ogg, .mp3) as voice/audio "+ "messages, video (.mp4) inline, other files as attachments."+)diff --git a/plugins/platforms/mattermost/adapter.py b/plugins/platforms/mattermost/adapter.pyindex b6e5920fe6b..290c8bbeedd 100644--- a/plugins/platforms/mattermost/adapter.py+++ b/plugins/platforms/mattermost/adapter.py@@ -714,6 +714,15 @@ def _apply_yaml_config(yaml_cfg: dict, mattermost_cfg: dict) -> dict | None:_is_connected = _env_is_connected("MATTERMOST_TOKEN", "MATTERMOST_URL")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "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 "+ " are rendered as inline previews automatically."+)+def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""@@ -726,4 +735,7 @@ def register(ctx) -> None:allowed_users_env="MATTERMOST_ALLOWED_USERS", allow_all_env="MATTERMOST_ALLOW_ALL_USERS",cron_deliver_env_var="MATTERMOST_HOME_CHANNEL",standalone_sender_fn=_standalone_send, # out-of-process cron; without it `deliver=mattermost` fails- max_message_length=MAX_POST_LENGTH, emoji="💬", allow_update_command=True)+ max_message_length=MAX_POST_LENGTH, emoji="💬", allow_update_command=True,+ platform_hint=_PLATFORM_HINT,+ display_tier="medium",+ )diff --git a/plugins/platforms/photon/adapter.py b/plugins/platforms/photon/adapter.pyindex c0af63f119f..ca8d3be4d63 100644--- a/plugins/platforms/photon/adapter.py+++ b/plugins/platforms/photon/adapter.py@@ -1722,7 +1722,10 @@ def register(ctx) -> None:"sends as a rich preview card. You can send files natively: write MEDIA:/absolute/path/to/file ""in your response (images and video appear inline, audio as voice notes, other files as ""attachments). Recipient identifiers are E.164 phone numbers; never expose them in responses "- "unless the user asked."))+ "unless the user asked."),+ # Permanent-message iMessage inboxes (no edit).+ display_tier="low",+ )ctx.register_cli_command(name="photon", help="Set up and manage the Photon iMessage integration",setup_fn=_cli.register_cli, handler_fn=_cli.dispatch)diff --git a/plugins/platforms/qqbot/register.py b/plugins/platforms/qqbot/register.pyindex 900a603f1d6..fede1f86e93 100644--- a/plugins/platforms/qqbot/register.py+++ b/plugins/platforms/qqbot/register.py@@ -122,6 +122,14 @@ def setup_qqbot() -> None:_gw().print_info(f" App ID: {credentials['app_id']}")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are on QQ, a popular Chinese messaging platform. QQ supports markdown formatting "+ "and emoji. You can send media files natively: include MEDIA:/absolute/path/to/file in "+ "your response. Images are sent as native photos, and other files arrive as downloadable documents."+)++def register(ctx) -> None:ctx.register_platform(name="qqbot",@@ -140,4 +148,5 @@ def register(ctx) -> None:standalone_sender_fn=standalone_send,# QQ's dm/group policy is YAML-only (no env var); QQ_ALLOW_ALL_USERS is still the opt-in.own_policy_env=("", ""),+ platform_hint=_PLATFORM_HINT,)diff --git a/plugins/platforms/signal/register.py b/plugins/platforms/signal/register.pyindex 241993aee24..f726fe92589 100644--- a/plugins/platforms/signal/register.py+++ b/plugins/platforms/signal/register.py@@ -32,6 +32,15 @@ def _validate_config(config: PlatformConfig) -> bool:return False+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are on Signal. Standard markdown (**bold**, *italic*, ~~strike~~, # headers, `code`) auto-converts to "+ "Signal formatting; bullets render as \u2022. No tables \u2014 use bullets or labeled lines. "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.png, .jpg, .webp) send as photos, other files as documents;  sends as photos."+)++def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""ctx.register_platform(@@ -45,4 +54,7 @@ def register(ctx) -> None:# Out-of-process sends speak raw JSON-RPC and bypass SignalAdapter.send()'s chunking, so# send_message splits at the adapter's limit through this field.standalone_sender_fn=standalone_send, max_message_length=MAX_MESSAGE_LENGTH,- emoji="📡", pii_safe=True, allow_update_command=True)+ emoji="📡", pii_safe=True, allow_update_command=True,+ platform_hint=_PLATFORM_HINT,+ display_tier="low",+ )diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.pyindex 2521cbea695..5787db25f76 100644--- a/plugins/platforms/slack/adapter.py+++ b/plugins/platforms/slack/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's PLATFORM_HINTS/_PLATFORM_DEFAULTS rows for this platform moved onto its register() call (hint text lives in adapter_hint.py); the growth is only those kwargs"""Slack platform adapter: slack-bolt Socket Mode (messages, slash commands, threads)."""import asyncio@@ -6908,9 +6909,9 @@ def _apply_yaml_config(yaml_cfg: dict, slack_cfg: dict) -> dict | None:_is_connected = _env_is_connected("SLACK_BOT_TOKEN")-def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""+ from plugins.platforms.slack.adapter_hint import PLATFORM_HINTctx.register_platform(name="slack",label="Slack",@@ -6937,4 +6938,9 @@ def register(ctx) -> None:max_message_length=39000,emoji="💼",allow_update_command=True,- allow_bots_env="SLACK_ALLOW_BOTS")+ allow_bots_env="SLACK_ALLOW_BOTS",+ platform_hint=PLATFORM_HINT,+ display_tier="medium",+ # Bolt posts cannot be edited like CLI; "new"/"all" spam permanent lines.+ display_overrides={"tool_progress": "off", "long_running_notifications": False, "busy_ack_detail": False},+ )diff --git a/plugins/platforms/slack/adapter_hint.py b/plugins/platforms/slack/adapter_hint.pynew file mode 100644index 00000000000..d774e87fb18--- /dev/null+++ b/plugins/platforms/slack/adapter_hint.py@@ -0,0 +1,12 @@+"""Slack system-prompt platform hint (``PlatformEntry.platform_hint``), kept out of the adapter facade.++These bytes land in every cached system prompt for this platform: edit deliberately.+"""++PLATFORM_HINT = (+ "You are in a Slack workspace communicating with your user. Standard markdown is auto-converted to Slack "+ "formatting (bold, headers, links, code); tables are NOT supported — use bullet lists or labeled lines. You "+ "can send media files natively: include MEDIA:/absolute/path/to/file in your response. Images (.png, .jpg, "+ ".webp) are uploaded as photo attachments, audio as file attachments. You can also include image URLs in "+ "markdown format  and they will be uploaded as attachments."+)diff --git a/plugins/platforms/sms/adapter.py b/plugins/platforms/sms/adapter.pyindex 80c94024247..a671a120bd0 100644--- a/plugins/platforms/sms/adapter.py+++ b/plugins/platforms/sms/adapter.py@@ -329,6 +329,12 @@ async def _standalone_send(pconfig, chat_id, message, *, thread_id=None, media_f_is_connected = _env_is_connected("TWILIO_ACCOUNT_SID")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are communicating via SMS. Keep responses concise and use plain text only — no markdown, no "+ "formatting. SMS messages are limited to ~1600 characters, so be brief and direct."+)+def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""@@ -339,4 +345,7 @@ def register(ctx) -> None:install_hint="pip install aiohttp", allowed_users_env="SMS_ALLOWED_USERS",allow_all_env="SMS_ALLOW_ALL_USERS", cron_deliver_env_var="SMS_HOME_CHANNEL",standalone_sender_fn=_standalone_send, max_message_length=MAX_SMS_LENGTH, pii_safe=True,- emoji="📱", allow_update_command=True)+ emoji="📱", allow_update_command=True,+ platform_hint=_PLATFORM_HINT,+ display_tier="minimal",+ )diff --git a/plugins/platforms/telegram/adapter.py b/plugins/platforms/telegram/adapter.pyindex fb0869a1a8b..497ef9479e9 100644--- a/plugins/platforms/telegram/adapter.py+++ b/plugins/platforms/telegram/adapter.py@@ -1,3 +1,4 @@+# health: allow FILE_LINES -- platform-tables refactor: core's PLATFORM_HINTS/_PLATFORM_DEFAULTS rows for this platform moved onto its register() call (hint text lives in adapter_hint.py); the growth is only those kwargs"""Telegram platform adapter (python-telegram-bot): inbound messages/media/commands, outbound replies."""import asyncio@@ -7309,10 +7310,16 @@ def _apply_yaml_config(yaml_cfg: dict, telegram_cfg: dict) -> dict | None:def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""+ from plugins.platforms.telegram.adapter_hint import PLATFORM_HINTctx.register_platform(name="telegram", label="Telegram", adapter_factory=_build_adapter, check_fn=telegram_deps_present,ensure_deps_fn=check_telegram_requirements, is_connected=_is_connected, required_env=["TELEGRAM_BOT_TOKEN"],install_hint=t("platform.telegram.install_hint"), setup_fn=interactive_setup, apply_yaml_config_fn=_apply_yaml_config,allowed_users_env="TELEGRAM_ALLOWED_USERS", allow_all_env="TELEGRAM_ALLOW_ALL_USERS", cron_deliver_env_var="TELEGRAM_HOME_CHANNEL",standalone_sender_fn=_standalone_send, max_message_length=4096, emoji="✈️", allow_update_command=True,- allow_bots_env="TELEGRAM_ALLOW_BOTS")+ allow_bots_env="TELEGRAM_ALLOW_BOTS",+ platform_hint=PLATFORM_HINT,+ display_tier="high",+ # Mobile inbox: quiet tool_progress / busy-ack, but keep interim commentary and heartbeats.+ display_overrides={"tool_progress": "off", "busy_ack_detail": False},+ )diff --git a/plugins/platforms/telegram/adapter_hint.py b/plugins/platforms/telegram/adapter_hint.pynew file mode 100644index 00000000000..d82986fbf5d--- /dev/null+++ b/plugins/platforms/telegram/adapter_hint.py@@ -0,0 +1,14 @@+"""Telegram system-prompt platform hint (``PlatformEntry.platform_hint``), kept out of the adapter facade.++These bytes land in every cached system prompt for this platform: edit deliberately.+"""++PLATFORM_HINT = (+ "You are on Telegram. Standard Markdown auto-converts: **bold**, "+ "*italic*, ~~strikethrough~~, ||spoiler||, `code`, ```blocks```, "+ "[links](url), ## headers. Prefer bullets or labeled lines for structured data (no tables). "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.png, .jpg, .webp) send as photos, videos (.mp4) play inline; image URLs via  send as "+ "photos. Audio: add [[audio_as_voice]] on its own line to send ANY audio file as a native voice bubble "+ "(non-Opus transcodes automatically); without it, .mp3/.m4a arrive as audio files, other formats as documents."+)diff --git a/plugins/platforms/wecom/adapter.py b/plugins/platforms/wecom/adapter.pyindex 8ca5384fe74..2feed9acc84 100644--- a/plugins/platforms/wecom/adapter.py+++ b/plugins/platforms/wecom/adapter.py@@ -834,6 +834,16 @@ def _build_callback_adapter(config):return WecomCallbackAdapter(config)+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_WECOM_PLATFORM_HINT = (+ "You are on WeCom (\u4f01\u4e1a\u5fae\u4fe1). Markdown is supported. "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.jpg, .png, .webp) send as photos (\u226410 MB), other files as documents (\u226420 MB), videos "+ "(.mp4) play inline. Voice messages must be AMR \u2014 other audio formats send as file attachments. Image "+ "URLs via  are downloaded and sent as photos. Never claim you lack file-sending."+)++def register(ctx) -> None:common = dict(install_hint="Run `hermes setup` to install WeCom support.", emoji="💼", allow_update_command=True)ctx.register_platform(@@ -842,6 +852,10 @@ def register(ctx) -> None:setup_fn=interactive_setup, allowed_users_env="WECOM_ALLOWED_USERS", allow_all_env="WECOM_ALLOW_ALL_USERS",cron_deliver_env_var="WECOM_HOME_CHANNEL", standalone_sender_fn=_standalone_send, max_message_length=4000, **common,own_policy_env=("WECOM_DM_POLICY", "WECOM_GROUP_POLICY"),+ platform_hint=_WECOM_PLATFORM_HINT,+ display_tier="low",+ # Non-editable, but its native "stream" msgtype gives a typing animation + cumulative updates.+ display_overrides={"streaming": True},)from plugins.platforms.wecom.callback_adapter import check_wecom_callback_requirements, ensure_wecom_callback_requirementsctx.register_platform(@@ -850,4 +864,5 @@ def register(ctx) -> None:is_connected=_callback_is_connected, validate_config=_callback_is_connected,required_env=["WECOM_CALLBACK_CORP_ID", "WECOM_CALLBACK_CORP_SECRET"],allowed_users_env="WECOM_CALLBACK_ALLOWED_USERS", allow_all_env="WECOM_CALLBACK_ALLOW_ALL_USERS", **common,+ display_tier="low",)diff --git a/plugins/platforms/weixin/adapter.py b/plugins/platforms/weixin/adapter.pyindex 88ffa6f31d2..36138c317af 100644--- a/plugins/platforms/weixin/adapter.py+++ b/plugins/platforms/weixin/adapter.py@@ -1390,6 +1390,16 @@ def interactive_setup() -> None:gw.print_info(f" User ID: {user_id}")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "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: include "+ "MEDIA:/absolute/path/to/file in your response. Images are sent as native photos, videos play inline when "+ "supported, and other files arrive as downloadable documents. You can also include image URLs in markdown "+ "format  and they will be downloaded and sent as native media when possible."+)++def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""ctx.register_platform(@@ -1402,4 +1412,6 @@ def register(ctx) -> None:# max_message_length stays 0: send_message hands the full text + all media to one native send.standalone_sender_fn=_standalone_send, max_message_length=0, emoji="💬", allow_update_command=True,own_policy_env=("WEIXIN_DM_POLICY", "WEIXIN_GROUP_POLICY"),+ platform_hint=_PLATFORM_HINT,+ display_tier="low",)diff --git a/plugins/platforms/whatsapp/adapter.py b/plugins/platforms/whatsapp/adapter.pyindex e75e3b9a961..0ab4800111b 100644--- a/plugins/platforms/whatsapp/adapter.py+++ b/plugins/platforms/whatsapp/adapter.py@@ -1230,6 +1230,15 @@ def _is_connected(config) -> bool:return (gateway_mod.get_env_value("WHATSAPP_ENABLED") or "").strip().lower() in {"true", "1", "yes"}+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are on WhatsApp. Standard markdown auto-converts to WhatsApp syntax (*bold*, _italic_, ~strike~, "+ "monospace) \u2014 write markdown freely, bullets included. No tables \u2014 use bullets or labeled lines. "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.jpg, .png, .webp) send as photos, videos (.mp4, .mov) play "+ "inline, other files arrive as documents; image URLs via  send as photos."+)+def register(ctx) -> None:ctx.register_platform(@@ -1240,4 +1249,7 @@ def register(ctx) -> None:allow_all_env="WHATSAPP_ALLOW_ALL_USERS", cron_deliver_env_var="WHATSAPP_HOME_CHANNEL",standalone_sender_fn=_standalone_send, max_message_length=4096, emoji="💬", allow_update_command=True,own_policy_env=("WHATSAPP_DM_POLICY", "WHATSAPP_GROUP_POLICY"),+ platform_hint=_PLATFORM_HINT,+ # Baileys bridge supports /edit.+ display_tier="medium",)diff --git a/plugins/platforms/whatsapp_cloud/adapter.py b/plugins/platforms/whatsapp_cloud/adapter.pyindex 973f2d20128..eaaff53d13b 100644--- a/plugins/platforms/whatsapp_cloud/adapter.py+++ b/plugins/platforms/whatsapp_cloud/adapter.py@@ -1086,6 +1086,17 @@ def _interactive_setup() -> None:run_whatsapp_cloud_setup()+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are on WhatsApp (Meta Business Cloud API). Standard markdown auto-converts to WhatsApp syntax "+ "\u2014 write markdown freely. No tables \u2014 use bullets or labeled lines. "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.jpg, .png) send as photos, videos (.mp4) inline, audio as voice/audio, other files as "+ "documents;  works. NOTE: Meta refuses free-form replies when the user hasn't messaged in "+ "24h (error 131047) \u2014 relevant only for delayed/scheduled sends."+)++def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system.@@ -1101,4 +1112,7 @@ def register(ctx) -> None:install_hint="aiohttp/httpx missing — reinstall hermes-agent", setup_fn=_interactive_setup,allowed_users_env="WHATSAPP_CLOUD_ALLOWED_USERS", allow_all_env="WHATSAPP_CLOUD_ALLOW_ALL_USERS",cron_deliver_env_var="WHATSAPP_CLOUD_HOME_CHANNEL", emoji="📱", allow_update_command=False,+ platform_hint=_PLATFORM_HINT,+ # Adapter lacks edit_message; promote once it lands.+ display_tier="low",)diff --git a/plugins/platforms/yuanbao/register.py b/plugins/platforms/yuanbao/register.pyindex 4c5f1968cc6..67227b9a877 100644--- a/plugins/platforms/yuanbao/register.py+++ b/plugins/platforms/yuanbao/register.py@@ -65,6 +65,20 @@ async def _standalone_send(pconfig, chat_id, message, *, thread_id=None, media_freturn send_error(f"Yuanbao send failed: {e}")+# System-prompt platform hint (PlatformEntry.platform_hint); cached-prompt bytes, keep stable.+_PLATFORM_HINT = (+ "You are on Yuanbao (\u817e\u8baf\u5143\u5b9d), a Chinese AI assistant "+ "platform. Markdown renders (code blocks, tables, bold/italic). "+ "You can send files natively: write MEDIA:/absolute/path/to/file in your response. "+ "Images (.jpg, .png, .webp, .gif) send as photos, other files as downloadable documents (max 50 MB); "+ "image URLs via  are downloaded and sent as photos. Never claim you lack file-sending. "+ "Stickers (\u8d34\u7eb8/\u8868\u60c5\u5305): when the user sends one (you see '[emoji: "+ "\u540d\u79f0]') or asks for one, use the sticker tools \u2014 yb_search_sticker with a Chinese "+ "keyword, then yb_send_sticker with the chosen id \u2014 which send a real native sticker. Never "+ "draw sticker-like PNGs and send them as images, and bare Unicode emoji is not a substitute."+)++def register(ctx) -> None:"""Plugin entry point — called by the Hermes plugin system."""ctx.register_platform(@@ -76,4 +90,5 @@ def register(ctx) -> None:allow_all_env="YUANBAO_ALLOW_ALL_USERS", cron_deliver_env_var="YUANBAO_HOME_CHANNEL",standalone_sender_fn=_standalone_send, emoji="💎", allow_update_command=False,own_policy_env=("YUANBAO_DM_POLICY", "YUANBAO_GROUP_POLICY"),+ platform_hint=_PLATFORM_HINT,)diff --git a/tests/agent/test_platform_hint_cron_delivery.py b/tests/agent/test_platform_hint_cron_delivery.pyindex 1acaed09a1f..c327e603fb7 100644--- a/tests/agent/test_platform_hint_cron_delivery.py+++ b/tests/agent/test_platform_hint_cron_delivery.py@@ -12,7 +12,9 @@ import pytestfrom agent.prompt_builder import PLATFORM_HINTSfrom agent.system_prompt import platform_hint+from gateway.platform_registry import platform_registryfrom gateway.session_context import _VAR_MAP+from hermes_cli.plugins import discover_pluginsEXTRA = "Always attach the report as a .pdf."@@ -26,6 +28,7 @@ def deliver_to(monkeypatch):var = _VAR_MAP["HERMES_CRON_AUTO_DELIVER_PLATFORM"]token = var.set("slack")monkeypatch.delenv("HERMES_DESKTOP_TERMINAL", raising=False)+ discover_plugins() # messaging hints ship on each plugin's PlatformEntryyieldvar.reset(token)@@ -33,13 +36,13 @@ def deliver_to(monkeypatch):def test_cron_agent_gets_delivery_channel_hint_with_its_override(deliver_to):hint = platform_hint(_agent("cron", {"slack": {"append": EXTRA}}))assert hint.startswith(PLATFORM_HINTS["cron"])- assert PLATFORM_HINTS["slack"] in hint+ assert platform_registry.get("slack").platform_hint in hintassert EXTRA in hint# The cron hint's own override channel is untouched by the destination's.assert platform_hint(_agent("cron", {"cron": {"replace": "X"}})).startswith("X\n\n")def test_delivery_target_only_applies_to_cron_agents(deliver_to):- assert platform_hint(_agent("telegram")) == PLATFORM_HINTS["telegram"]+ assert platform_hint(_agent("telegram")) == platform_registry.get("telegram").platform_hint_VAR_MAP["HERMES_CRON_AUTO_DELIVER_PLATFORM"].set("")assert platform_hint(_agent("cron")) == PLATFORM_HINTS["cron"]diff --git a/tests/gateway/test_buzz_thread_topology.py b/tests/gateway/test_buzz_thread_topology.pyindex e5e208038db..a65a7fc16f7 100644--- a/tests/gateway/test_buzz_thread_topology.py+++ b/tests/gateway/test_buzz_thread_topology.py@@ -337,7 +337,9 @@ class TestDisplayDefaults:def test_buzz_does_not_inherit_verbose_global_tool_progress(self):from gateway.display_config import resolve_display_setting+ from hermes_cli.plugins import discover_plugins+ discover_plugins() # the tier ships on buzz's PlatformEntry (display_tier)# No user config: must come from the buzz platform tier, not the# verbose _GLOBAL_DEFAULTS ("all").assert resolve_display_setting({}, "buzz", "tool_progress") != "all"diff --git a/tests/gateway/test_display_config.py b/tests/gateway/test_display_config.pyindex d349c90291b..c898b7cfb3e 100644--- a/tests/gateway/test_display_config.py+++ b/tests/gateway/test_display_config.py@@ -7,7 +7,9 @@class TestToolProgressProvenance:def test_winning_source_controls_mode_and_intent(self):from gateway.display_config import resolve_tool_progress+ from hermes_cli.plugins import discover_plugins+ discover_plugins() # slack's "off" default ships on its PlatformEntry (display_overrides)cases = [({}, None, ("off", False)),({}, "all", ("all", True)),@@ -137,10 +139,15 @@ def assert_keeps_platform_display_defaults(cfg):Shared by every config seeder's regression test: a seeded global ``display.<key>`` beats eachplatform tier, because the gateway loader merges no DEFAULT_CONFIG (#121230)."""- from gateway.display_config import _PLATFORM_DEFAULTS, resolve_display_setting, resolve_tool_progress-- tier_keys = {key for tier in _PLATFORM_DEFAULTS.values() for key in tier}- for platform in _PLATFORM_DEFAULTS:+ from gateway.display_config import _PLATFORM_DEFAULTS, _platform_defaults, resolve_display_setting, resolve_tool_progress+ from gateway.platform_registry import platform_registry+ from hermes_cli.plugins import discover_plugins++ # Core-only rows plus every plugin platform that declares display defaults on its PlatformEntry.+ discover_plugins()+ platforms = set(_PLATFORM_DEFAULTS) | {e.name for e in platform_registry.all_entries() if e.display_tier}+ tier_keys = {key for platform in platforms for key in _platform_defaults(platform)}+ for platform in sorted(platforms):assert resolve_tool_progress(cfg, platform) == resolve_tool_progress({}, platform), platformfor key in tier_keys:assert resolve_display_setting(cfg, platform, key) == resolve_display_setting({}, platform, key), (diff --git a/tests/gateway/test_platform_entry_plugin_seams.py b/tests/gateway/test_platform_entry_plugin_seams.pyindex ebd0145fc6f..2bd4c422da2 100644--- a/tests/gateway/test_platform_entry_plugin_seams.py+++ b/tests/gateway/test_platform_entry_plugin_seams.py@@ -85,3 +85,14 @@ def test_user_plugin_cannot_mark_a_core_platform_trusted_inbound():assert platform_registry.get("seameventbus").trusted_inbound is Truefinally:platform_registry.unregister("seameventbus", scope=platform_registry.current_scope_key())+++def test_core_hint_and_display_tables_hold_no_bundled_plugin_platform():+ """A bundled platform's prompt hint and display defaults live on its PlatformEntry only, so the+ plugin is the single source of truth (no core row silently shadowing what the plugin declares)."""+ from agent.prompt_builder import PLATFORM_HINTS+ from gateway.display_config import _PLATFORM_DEFAULTS++ bundled = set(Platform._scan_bundled_plugin_platforms()[0])+ assert bundled+ assert not (set(PLATFORM_HINTS) | set(_PLATFORM_DEFAULTS)) & bundleddiff --git a/tests/plugins/platforms/test_qqbot_plugin.py b/tests/plugins/platforms/test_qqbot_plugin.pyindex ea48c1fd6a0..16904fb63b8 100644--- a/tests/plugins/platforms/test_qqbot_plugin.py+++ b/tests/plugins/platforms/test_qqbot_plugin.py@@ -52,12 +52,15 @@ def test_is_connected_needs_both_credentials(monkeypatch):assert is_connected(PlatformConfig(enabled=True)) is True-def test_qqbot_platform_hint_comes_from_the_builtin_table():- from agent.prompt_builder import PLATFORM_HINTS+def test_qqbot_platform_hint_comes_from_its_platform_entry():from agent.system_prompt import _default_platform_hint+ from gateway.platform_registry import platform_registry+ from hermes_cli.plugins import discover_plugins- assert "MEDIA:" in PLATFORM_HINTS["qqbot"]- assert _default_platform_hint("qqbot") == PLATFORM_HINTS["qqbot"]+ discover_plugins()+ hint = platform_registry.get("qqbot").platform_hint+ assert "MEDIA:" in hint+ assert _default_platform_hint("qqbot") == hintdef test_qqbot_is_a_builtin_deliver_target():