fix(feishu): remove outdated markdown table fallback, always use post format - #65529
Closed
hacxy wants to merge 1 commit into
Closed
fix(feishu): remove outdated markdown table fallback, always use post format#65529hacxy wants to merge 1 commit into
hacxy wants to merge 1 commit into
Conversation
… format Feishu's post-type 'md' elements now natively support all markdown syntax including pipe tables. The old _MARKDOWN_TABLE_RE fallback forced table messages to plain text, causing them to render as raw source code instead of formatted tables. Changes: - Remove the table-to-text fallback in _build_outbound_payload() - Add _MARKDOWN_TABLE_RE check alongside _MARKDOWN_HINT_RE so tables route through the post format with md elements - Add 12 tests covering table routing, regex matching, and payload format Fixes NousResearch#38755
Contributor
|
Closing — this was fixed on main by #68121, which removes the |
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.
Summary
Feishu's post-type
mdelements now natively support all markdown syntax including pipe tables. The old_MARKDOWN_TABLE_REfallback forced table messages to plain text, causing them to render as raw source code instead of formatted tables.Changes
_build_outbound_payload()_MARKDOWN_TABLE_REcheck alongside_MARKDOWN_HINT_REso tables route through the post format withmdelementsProblem
When the agent sends a markdown table in Feishu, the adapter's
_build_outbound_payload()method detects the table pattern via_MARKDOWN_TABLE_REand forces the message to plain text (msg_type: "text"). This causes the table to appear as raw markdown source code instead of a rendered table.Root Cause
The old code assumed Feishu's post-type
mdelements could not render markdown tables, so it fell back to plain text. However, Feishu has since updated their post format to support all markdown syntax including pipe tables.Fix
Instead of falling back to plain text for table content, we now route tables through the same post format as other markdown content (
_MARKDOWN_HINT_RE). The_build_markdown_post_payload()function already handles the conversion correctly.Testing
Added 12 new tests in
tests/gateway/test_feishu_outbound_payload.pycovering:_MARKDOWN_TABLE_REregex matching (simple table, heading row, plain text, single pipe)_build_outbound_payload()routing (table → post, heading → post, plain text → text, mixed content)_build_markdown_post_payload()output formatFixes #38755