fix(core): restore italic wrapping on reply footer

The previous commit stripped asterisks from the footer to work around
Feishu italic rendering, but this broke four unit tests and caused
appendFinalMetadataToSegment to fail to re-attach the footer to tool
call segments (it relies on the "\n\n*" pattern).

Revert to wrapping the footer in *...* in the platform-agnostic core.
If Feishu needs to suppress italic rendering, that should be handled
inside platform/feishu at content-build time.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ClaudeandCursor committed 2026-05-20 22:16:08 +08:00
1 parent 91c46b9ee6
commit a2cc0ab117
1 file changed
+3 -6
+3 -6
View File
@@ -5707,18 +5707,15 @@ func appendReplyFooter(content, footer string) string {
return content
}
content = strings.TrimRight(content, "\n")
// Strip any existing asterisks from footer to prevent Feishu card markdown
// from rendering *text* as italic when the platform uses markdown rendering.
cleanFooter := strings.ReplaceAll(footer, "*", "")
last30 := content
if len(last30) > 30 {
last30 = last30[len(last30)-30:]
}
slog.Debug("appendReplyFooter", "content_len", len(content), "footer", footer, "clean_footer", cleanFooter, "content_last30", last30)
slog.Debug("appendReplyFooter", "content_len", len(content), "footer", footer, "content_last30", last30)
if content == "" {
return cleanFooter
return "*" + footer + "*"
}
return content + "\n\n" + cleanFooter
return content + "\n\n*" + footer + "*"
}
func appendFinalMetadataToSegment(segment, fullResponse string) string {