Skip to content

feat(feishu): structured cards with identity header and streaming enhancements#25624

Closed
nszhsl wants to merge 2 commits intoopenclaw:mainfrom
nszhsl:fix/feishu-stream-thinking
Closed

feat(feishu): structured cards with identity header and streaming enhancements#25624
nszhsl wants to merge 2 commits intoopenclaw:mainfrom
nszhsl:fix/feishu-stream-thinking

Conversation

@nszhsl
Copy link
Copy Markdown
Contributor

@nszhsl nszhsl commented Feb 24, 2026

Summary

  • Structured card rendering: Feishu cards now automatically include a colored header (agent emoji + name) and a grey note footer (agent name, model, provider) — all read from the existing IdentityConfig. No hardcoded agent names or icons.
  • Streaming card enhancements: FeishuStreamingSession.start() accepts header/note options; note is updated at close() with final model/provider info via the Card Kit element update API. Added a flush timer so throttled partial updates are not silently dropped.
  • Thinking stream: Reasoning/thinking content is streamed in real-time as 💭 Thinking... instead of showing a static label.
  • Outbound adapter card support: feishuOutbound.sendText() now respects renderMode and sends structured cards for direct-send messages (e.g. subagent completion results), using identity when available.
  • Plugin SDK exports: resolveAgentIdentity and IdentityConfig are now exported from openclaw/plugin-sdk for use by channel extensions.

Changed files

File Change
src/plugin-sdk/index.ts Export resolveAgentIdentity + IdentityConfig
extensions/feishu/src/send.ts Add CardHeaderConfig, buildStructuredCard(), sendStructuredCardFeishu()
extensions/feishu/src/streaming-card.ts Header/note in start(), updateNoteContent(), note update in close(), flush timer
extensions/feishu/src/reply-dispatcher.ts Read identity, build header/note, use structured cards, stream thinking content
extensions/feishu/src/outbound.ts Card format for outbound sendText when renderMode=card

Test plan

  • Send message to an agent with identity configured → card has colored header with emoji + name
  • Verify note footer shows Agent: name | Model: ... | Provider: ... after streaming closes
  • Long reply → streaming updates show intermediate content (not just thinking → final)
  • Thinking/reasoning content streams as 💭 Thinking... in real-time
  • Agent without identity config → fallback to agentId as title, no emoji, blue color
  • renderMode: "auto" and renderMode: "raw" modes unaffected
  • Subagent completion messages sent as cards when renderMode: "card"
  • Existing tests pass: reply-dispatcher.test.ts, send.test.ts

🤖 Generated with Claude Code

The Feishu reply dispatcher was missing the onReasoningStream callback,
causing thinking/reasoning content from the AI model to be silently
discarded. The streaming card only showed a static "⏳ Thinking..." label
until the final reply text arrived.

Add onReasoningStream and onReasoningEnd handlers that pipe reasoning
deltas through the existing streaming card session, so users can see
the model's thinking process in real time.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle bot added channel: feishu Channel integration: feishu size: XS labels Feb 24, 2026
…cements

Add gateway-level structured card rendering so agents get properly
formatted Feishu cards without manual intervention.

- Export resolveAgentIdentity and IdentityConfig from plugin-sdk
- Add buildStructuredCard / sendStructuredCardFeishu with optional
  header (title + color from identity config) and note footer
- Streaming cards: accept header/note options in start(), update note
  at close() with final model/provider info via Card Kit element API
- Add flush timer to streaming throttle so pending updates are not lost
- Reply dispatcher reads agent identity and passes header/note to both
  streaming and non-streaming card paths
- Outbound adapter respects renderMode and uses structured cards for
  direct-send messages (e.g. subagent results)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@nszhsl nszhsl changed the title fix(feishu): stream thinking content in card instead of static label feat(feishu): structured cards with identity header and streaming enhancements Feb 25, 2026
@nszhsl nszhsl closed this by deleting the head repository Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant