Skip to content

Add feishu markdown card support#3866

Merged
theonlyhennygod merged 1 commit intozeroclaw-labs:masterfrom
luikore:feature/lark-markdown-card-and-approval
Mar 20, 2026
Merged

Add feishu markdown card support#3866
theonlyhennygod merged 1 commit intozeroclaw-labs:masterfrom
luikore:feature/lark-markdown-card-and-approval

Conversation

@luikore
Copy link
Copy Markdown
Contributor

@luikore luikore commented Mar 18, 2026

Summary

  • Problem: Lark/Feishu channel sent responses as plain msg_type: "text" messages, losing all markdown formatting. Existing PR became stale and conflicts with current master.
  • Why it matters: Feishu interactive cards render markdown natively (bold, code blocks, lists, links, tables), producing significantly better readability for agent responses. Approval buttons let operators approve/deny tool execution directly from the chat.

What changed:

  • Markdown format feishu cards (schema v2) and tests
  • What did not change (scope boundary): No changes to the Channel trait interface, config schema, other channels, or security policy.

Label Snapshot (required)

  • Risk label: risk: medium
  • Size label: size: S
  • Scope labels: channel
  • Module labels: channel: lark
  • Contributor tier label: (auto-managed)

Change Metadata

  • Change type: feature
  • Primary scope: channel

Supersede Attribution (required when Supersedes # is used)

N/A

Validation Evidence (required)

IMG_8641

Commands and result summary:

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test
  • output brief:
    Finished `test` profile [unoptimized + debuginfo] target(s) in 1m 49s
     Running unittests src/lib.rs (target/debug/deps/zeroclaw-6e459f9d5a5102f5)

running 4070 tests

test result: ok. 4068 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 4.28s

     Running unittests src/main.rs (target/debug/deps/zeroclaw-e28b6c1d87f22722)

running 4065 tests

test result: ok. 4063 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 3.98s

     Running tests/test_component.rs (target/debug/deps/component-cfbc895ada0b5064)

running 176 tests

test result: ok. 176 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s

     Running tests/test_integration.rs (target/debug/deps/integration-b7964c933aec38a5)

running 119 tests

test result: ok. 119 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s

     Running tests/test_live.rs (target/debug/deps/live-9422b9bd020349ed)

running 5 tests

test result: ok. 0 passed; 0 failed; 5 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/test_system.rs (target/debug/deps/system-6a113649d3c208b8)

running 5 tests

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

   Doc-tests zeroclaw

running 3 tests
test src/providers/telnyx.rs - providers::telnyx::TelnyxProvider (line 29) ... ignored
test src/util.rs - util::truncate_with_ellipsis (line 19) ... ignored
test src/tools/schema.rs - tools::schema (line 18) ... ok

test result: ok. 1 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.77s
  • If any command is intentionally skipped, explain why:

Security Impact (required)

  • New permissions/capabilities? No
  • New external network calls? No (uses existing Lark send message API)
  • Secrets/tokens handling changed? No
  • File system access scope changed? No

Privacy and Data Hygiene (required)

  • Data-hygiene status: pass
  • Redaction/anonymization notes: N/A
  • Neutral wording confirmation: all test fixtures use neutral project-scoped labels

Compatibility / Migration

  • Backward compatible? Yes — outgoing messages change format from plain text to interactive card; no config or API contract changes required
  • Config/env changes? No
  • Migration needed? No

i18n Follow-Through (required when docs or user-facing wording changes)

  • i18n follow-through triggered? No

Human Verification (required)

  • Verified scenarios: markdown card rendering with code blocks, bold, lists; long-message chunking across 28 KB boundary;
  • Edge cases checked: multibyte UTF-8 at chunk boundary, empty content, single-chunk passthrough, exactly-at-limit content

Side Effects / Blast Radius (required)

  • Affected subsystems/workflows: Lark/Feishu channel outbound message rendering
  • Potential unintended effects: existing Lark users see card-formatted responses instead of plain text (visual change, no data loss)
  • Guardrails/monitoring for early detection: existing health check unchanged; send failure path already logs and returns errors

Rollback Plan (required)

  • Fast rollback command/path: git revert — reverts to plain text msg_type: "text" sends
  • Feature flags or config toggles: none (could add a lark.card_mode config key if gradual rollout needed)
  • Observable failure symptoms: Lark send errors in logs; messages not appearing in Feishu chats

Risks and Mitigations

List real risks in this PR (or write None).

  • Risk:
    • Mitigation:

Copy link
Copy Markdown
Collaborator

@theonlyhennygod theonlyhennygod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Well-implemented switch from plain text to interactive card messages with markdown rendering. Chunking logic correctly handles line boundaries and UTF-8 char boundaries. Good test coverage.

@theonlyhennygod theonlyhennygod merged commit 05c9b81 into zeroclaw-labs:master Mar 20, 2026
17 checks passed
webhive pushed a commit to webhive/zeroclaw that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants