liuzhandCopilot fd262bf98d feat: Phase5A 流式输出支持,逐token实时显示
AgentLoop 重构:
- 新增 runStreaming(input, onToken) 流式模式
- 使用 chatModel.stream(Prompt) -> Flux<ChatResponse>
- 统一 executeLoop() 核心循环支持阻塞/流式两种模式
- 流式分片工具调用按ID去重累积
- 流式失败自动降级到阻塞模式
- AssistantMessage 使用 Builder 模式构建(构造器是protected)
- 新增 onStreamStart 回调(第一个token到达时停止spinner)
- 新增 getChatModel() / replaceHistory() 方法(为后续compact准备)

ReplSession 更新:
- handleInput 使用 runStreaming 替代 run
- 逐token直接输出到终端(out.print + flush)
- spinner在第一个token到达时自动停止

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 21:31:38 +08:00
S
Description
No description provided
Apache-2.0
11 MiB
Languages
Java 98.3%
PowerShell 0.7%
Python 0.6%
Shell 0.4%