fix(tool-hints): deduplicate by formatted string + per-line inline display

Two display fixes based on real-world Feishu testing:

1. tool_hints.py: format_tool_hints now deduplicates by comparing the
   fully formatted hint string instead of tool name alone. This fixes
   `ls /Desktop` and `ls /Downloads` being incorrectly merged as
   `ls /Desktop × 2`. Truly identical calls still fold correctly.
   (_group_consecutive and all abbreviation logic preserved unchanged.)

2. feishu.py: inline tool hints now display one tool per line with
   🔧 prefix, and use double-newline trailing to prevent Setext heading
   rendering when followed by markdown `---`.

Made-with: Cursor
This commit is contained in:
xzq.xu
2026-04-10 12:29:43 +08:00
committed by Xubin Ren
parent 512c3b88e3
commit 049ce9baae
2 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -1379,7 +1379,9 @@ class FeishuChannel(BaseChannel):
if buf and buf.card_id:
if buf.tool_hint_len > 0:
buf.text = buf.text[:-buf.tool_hint_len]
suffix = f"\n\n---\n🔧 {hint}"
lines = self._format_tool_hint_lines(hint).split("\n")
formatted = "\n".join(f"🔧 {ln}" for ln in lines if ln.strip())
suffix = f"\n\n{formatted}\n\n"
buf.text += suffix
buf.tool_hint_len = len(suffix)
buf.sequence += 1