feat(feishu): improve tool call card formatting for multiple tools

- Format multiple tool calls each on their own line
- Change title from 'Tool Call' to 'Tool Calls' (plural)
- Add explicit 'text' language for code block
- Improves readability and supports displaying longer content
- Update tests to match new formatting
This commit is contained in:
Tony
2026-03-13 14:48:36 +08:00
parent 7261bd8c3f
commit 82064efe51
2 changed files with 13 additions and 5 deletions
+7 -1
View File
@@ -827,12 +827,18 @@ class FeishuChannel(BaseChannel):
if msg.content and msg.content.strip():
# Create a simple card with a code block
code_text = msg.content.strip()
# Format tool calls: put each tool on its own line for better readability
# _tool_hint uses ", " to join multiple tool calls
if ", " in code_text:
formatted_code = code_text.replace(", ", ",\n")
else:
formatted_code = code_text
card = {
"config": {"wide_screen_mode": True},
"elements": [
{
"tag": "markdown",
"content": f"**Tool Call**\n\n```\n{code_text}\n```"
"content": f"**Tool Calls**\n\n```text\n{formatted_code}\n```"
}
]
}