feat(im): align agent stream display with web thinking and tool progress

Mirror Web AgentStreamDisplay/RagPipelineProgress in IM text streams:
retract live answers into 思考过程, show Web-aligned tool titles with
query/summary from structured data, and collapse thinking on finalize
instead of dropping it entirely.
This commit is contained in:
wizardchen
2026-06-23 23:33:19 +08:00
committed by lyingbug
parent ab3e472748
commit c3b036cb00
16 changed files with 2001 additions and 279 deletions
+6 -2
View File
@@ -146,8 +146,12 @@ type StreamSender interface {
// Returns a platform-specific stream ID for subsequent chunk/end calls.
StartStream(ctx context.Context, incoming *IncomingMessage) (string, error)
// SendStreamChunk appends a content chunk to an ongoing stream.
SendStreamChunk(ctx context.Context, incoming *IncomingMessage, streamID string, content string) error
// UpdateStreamContent replaces the user-visible stream text with fullContent so far.
// Platforms with replace semantics (WeCom, Telegram edit, etc.) show this as the entire message.
UpdateStreamContent(ctx context.Context, incoming *IncomingMessage, streamID string, fullContent string) error
// FinalizeStream performs the final replace with answer-only content (thinking/tools stripped).
FinalizeStream(ctx context.Context, incoming *IncomingMessage, streamID string, finalContent string) error
// EndStream finalizes a streaming reply.
EndStream(ctx context.Context, incoming *IncomingMessage, streamID string) error