# NousResearch/hermes-agent · Feishu table and code block rendering fixes

## Open now

- 1 issue, 1 PR open on GitHub.
- #19035: \[Feishu\] Code blocks cannot be expanded — only first ~2 lines visible
- PR #40445: feat(feishu): render markdown tables as native Card JSON 2.0 table components

Multiple attempts and approaches to fix how markdown tables and fenced code blocks are rendered in Feishu, including routing them through CardKit 2.0, native card components, and fallback modes. A related issue reports code blocks being truncated to only the first couple of lines.

## TL;DR

- 6 member(s): 1 open issue(s), 0 closed issue(s), 1 open PR(s), 1 merged PR(s), 3 PR(s) closed without merging.
- A fix was merged to main in PR #20275. Verify it addresses your case.
- **Recommended:** read PR #20275 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.33`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #19035: \[Feishu\] Code blocks cannot be expanded — only first ~2 lines visible

## Prior & competing PRs

- **#20275: fix(feishu): force text mode for markdown tables (salvage #13723)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `gateway/platforms/feishu.py`
  - fix hunks:
  - `gateway/platforms/feishu.py`

    ```diff
    @@ -153,6 +153,9 @@
         r"(^#{1,6}\s)|(^\s*[-*]\s)|(^\s*\d+\.\s)|(^\s*---+\s*$)|(```)|(`[^`\n]+`)|(\*\*[^*\n].+?\*\*)|(~~[^~\n].+?~~)|(<u>.+?</u>)|(\*[^*\n]+\*)|(\[[^\]]+\]\([^)]+\))|(^>\s)",
         re.MULTILINE,
     )
    +# Detect markdown tables: a line starting with | followed by a separator line.
    +# Feishu post-type 'md' elements do not render tables, so we force text mode.
    +_MARKDOWN_TABLE_RE = re.compile(r"^\|.*\|\n\|[-|: ]+\|", re.MULTILINE)
     _MARKDOWN_LINK_RE = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")
     _MARKDOWN_FENCE_OPEN_RE = re.compile(r"^```([^\n`]*)\s*$")
     _MARKDOWN_FENCE_CLOSE_RE = re.compile(r"^```\s*$")
    ```

    ```diff
    @@ -3995,6 +3998,12 @@ def _is_duplicate(self, message_id: str) -> bool:
         # =========================================================================
     
         def _build_outbound_payload(self, content: str) -> tuple[str, str]:
    +        # Feishu post-type 'md' elements do not render markdown tables; sending
    +        # table content as post causes the message to appear blank on the client.
    +        # Force plain text for anything that looks like a markdown table.
    +        if _MARKDOWN_TABLE_RE.search(content):
    +            text_payload = {"text": content}
    +            return "text", json.dumps(text_payload, ensure_ascii=False)
             if _MARKDOWN_HINT_RE.search(content):
                 return "post", _build_markdown_post_payload(content)
             text_payload = {"text": content}
    ```
- **#19038: fix(feishu): route tables and multi-line code blocks to CardKit 2.0**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#20275`, `#13723`, `#19035`, `#9549`
- **#23861: fix(feishu): route tables and code blocks to CardKit 2.0 with post/text fallback**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
- **#33310: fix(feishu): render markdown tables and code blocks via CardKit 2.0 cards**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#53453`, `#53355`, `#36877`
- **#40445: feat(feishu): render markdown tables as native Card JSON 2.0 table components**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `gateway/platforms/feishu.py`, `tests/gateway/test_feishu.py`

## Fix status

- Merged to main in PR #20275 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-05`.
- Subsystem: `gateway`
