feat(feishu): add configurable render modes for gateway replies - #39045
Open
Sherlock290 wants to merge 1 commit into
Open
feat(feishu): add configurable render modes for gateway replies#39045Sherlock290 wants to merge 1 commit into
Sherlock290 wants to merge 1 commit into
Conversation
…ry-pick) Cherry-picked from local patch 2995b85e7 onto official upstream. Adds three render modes for Feishu outbound messages: - auto (default): post-type with md elements, tables wrapped in code blocks - card: interactive card with markdown element (schema 2.0) - raw: plain text Config: feishu.render_mode in config.yaml or HERMES_FEISHU_RENDER_MODE env var.
This was referenced Jun 13, 2026
Closed
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the table-rendering workaround and covering the three proposed render paths.
Problems
- The PR introduces
HERMES_FEISHU_RENDER_MODEfor a non-secret display behavior (gateway/platforms/feishu.py, added_load_settingsline 1655 in the PR diff).AGENTS.md:102-106requires user-facing behavioral settings to useconfig.yaml, not a newHERMES_*variable. - Current main moved this adapter from
gateway/platforms/feishu.pytoplugins/platforms/feishu/adapter.pyin560010547; the YAML bridge is now plugin-owned atplugins/platforms/feishu/adapter.py:5624-5633. The PR is currently conflicting, so its core-file wiring cannot be salvaged unchanged. - The new public setting is not documented in the Feishu guide’s configuration/environment reference (
website/docs/user-guide/messaging/feishu.md:539-566).
Suggested changes
- Port the feature and tests to
plugins/platforms/feishu/adapter.py, using the plugin YAML-config hook. - Keep
feishu.render_modeas the user-facing knob and remove the newHERMES_FEISHU_RENDER_MODEfallback. - Document modes, defaults, and card prerequisites.
Automated hermes-sweeper review.
| ws_ping_interval=_coerce_int(extra.get("ws_ping_interval"), default=None, min_value=1), | ||
| ws_ping_timeout=_coerce_int(extra.get("ws_ping_timeout"), default=None, min_value=1), | ||
| render_mode=_normalize_render_mode( | ||
| extra.get("render_mode") or os.getenv("HERMES_FEISHU_RENDER_MODE", "auto") |
Contributor
There was a problem hiding this comment.
HERMES_FEISHU_RENDER_MODE is a new non-secret behavioral setting. Please keep this user-facing option in config.yaml only; AGENTS.md prohibits new HERMES_* configuration variables for display/feature behavior.
| @@ -893,7 +893,9 @@ def _merge_platform_map(source_platforms: Any) -> None: | |||
| bridged["group_allow_admin_from"] = platform_cfg["group_allow_admin_from"] | |||
| if "group_user_allowed_commands" in platform_cfg: | |||
| bridged["group_user_allowed_commands"] = platform_cfg["group_user_allowed_commands"] | |||
Contributor
There was a problem hiding this comment.
Current main migrated Feishu config handling into plugins/platforms/feishu/adapter.py::_apply_yaml_config (commit 560010547). Port this bridge there rather than restoring a Feishu-specific branch in core gateway config.
23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Feishu
post-type messages withmdelements have limited markdown support:card table number over limitAPI errors from the Feishu backendSolution
Add a
render_modeconfig option underfeishu:inconfig.yaml:auto(default): post-type withmdelements; GFM tables are wrapped in fenced code blocks so they render as monospace blocks rather than blank messagescard: Feishu interactive card withmarkdownelement (schema 2.0) — full markdown support including tablesraw: plain text, no formattingConfig
Or via env var:
HERMES_FEISHU_RENDER_MODE=cardChanges
gateway/platforms/feishu.py:_build_markdown_card_payload()— schema 2.0 card with markdown element_wrap_markdown_tables()— wraps GFM pipe tables in fenced code blocks forautomoderender_modefield toFeishuAdapterSettings_build_outbound_payload()to route by render modeSTREAM_SEGMENTS_IN_SINGLE_MESSAGE = Falsefor card mode (single-message delivery)gateway/config.py: bridgefeishu.render_modefrom config.yamlgateway/stream_consumer.py: respectSTREAM_SEGMENTS_IN_SINGLE_MESSAGEoverridetests/gateway/test_feishu.py: tests for all three render modes and table wrappingtests/gateway/test_stream_consumer.py: test for single-message stream override