feat(gemini): inline thinking display in conversation flow#2013
feat(gemini): inline thinking display in conversation flow#2013
Conversation
Convert Gemini thought events to thinking messages that are displayed inline in the conversation and persisted to the database, matching the ACP implementation from PR #1953. - GeminiAgentManager: add emitThinkingMessage/flushThinkingToDb, convert thought events to thinking messages, extract inline <think> tags from content, finalize thinking on finish signal - useGeminiMessage: handle thinking message type, track hasThinkingMessage - GeminiSendBox: hide ThoughtDisplay when thinking messages are shown inline
Code Review:feat(gemini): inline thinking display in conversation flow (#2013)变更概述本 PR 将 Gemini 的 方案评估结论:✅ 方案合理 方案正确解决了目标问题:通过 问题清单🟡 MEDIUM — 新增核心逻辑缺少单元测试文件: 问题代码: private emitThinkingMessage(content: string, status: 'thinking' | 'done' = 'thinking'): void { ... }
private flushThinkingToDb(duration: number | undefined, status: 'thinking' | 'done'): void { ... }问题说明:这两个方法包含有状态逻辑(内容积累、定时器管理、
修复建议:在 🔵 LOW —
|
| # | 严重级别 | 文件 | 问题 |
|---|---|---|---|
| 1 | 🟡 MEDIUM | GeminiAgentManager.ts:931-989 |
新增核心逻辑缺少单元测试 |
| 2 | 🔵 LOW | useGeminiMessage.ts:33 |
hasThinkingMessageRef 赋值但从未读取 |
结论
本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。
…gToDb - Cover content accumulation across multiple thought chunks - Verify thinkingMsgId reuse within a single turn - Assert DB flush timer is created on first chunk and cleared on done - Confirm flushThinkingToDb returns early when thinkingMsgId is null - Validate addOrUpdateMessage receives correct TMessage shape Review follow-up for #2013
PR Fix 验证报告原始 PR: #2013
总结: ✅ 已修复 1 个 | ❌ 未能修复 0 个
|
* feat(gemini): inline thinking display in conversation flow Convert Gemini thought events to thinking messages that are displayed inline in the conversation and persisted to the database, matching the ACP implementation from PR #1953. - GeminiAgentManager: add emitThinkingMessage/flushThinkingToDb, convert thought events to thinking messages, extract inline <think> tags from content, finalize thinking on finish signal - useGeminiMessage: handle thinking message type, track hasThinkingMessage - GeminiSendBox: hide ThoughtDisplay when thinking messages are shown inline * test(gemini): add unit tests for emitThinkingMessage and flushThinkingToDb - Cover content accumulation across multiple thought chunks - Verify thinkingMsgId reuse within a single turn - Assert DB flush timer is created on first chunk and cleared on done - Confirm flushThinkingToDb returns early when thinkingMsgId is null - Validate addOrUpdateMessage receives correct TMessage shape Review follow-up for #2013 --------- Co-authored-by: zk <[email protected]> Co-authored-by: zynx <>
Summary
thoughtstream events tothinkingtyped messages displayed inline in the conversation, matching ACP behavior from feat(acp): inline thinking display, plan dedup, and processing indicator fixes #1953emitThinkingMessage/flushThinkingToDbtoGeminiAgentManagerfor buffered DB persistence of thinking contentthinkingmessage type inuseGeminiMessagehook withhasThinkingMessagestate trackingThoughtDisplayfloating panel when thinking messages are shown inline inGeminiSendBoxTest plan
bun run lint— 0 errorsbunx tsc --noEmit— passbunx vitest run— pass (previewFileWatch failure is pre-existing on main)<think>tags in content (e.g. via proxy) have tags extracted and shown as thinking blocksCloses #2012