feat: Web 端接入思考流展示,修复 checkpoint/verify/文件变更等核心问题#569
feat: Web 端接入思考流展示,修复 checkpoint/verify/文件变更等核心问题#569phantom5099 merged 11 commits into1024XEngineer:mainfrom
Conversation
- 调整 build:electron 脚本顺序:先 vite build 生成 dist 产物,再编译网关, 保证 webembed 嵌入的是最新前端资源 - 在 setupAutoUpdater() 中检测 PORTABLE_EXECUTABLE_DIR,portable 模式下 跳过自动更新检查,避免 NSIS 不支持的更新流程误导用户 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| } | ||
| // 当存在 required TODO 且全部已终态时,清除 unverified writes 标记。 | ||
| // required TODO 全部收敛本身就证明工作已完成,无需额外 verification tool 调用。 | ||
| if !current.HasPendingAgentTodos && hasCompletedRequiredTodos(state.session.Todos) { |
There was a problem hiding this comment.
HasUnverifiedWrites is being cleared purely because all required todos are terminal. That lets a run complete after a successful write + todo_write set_status=completed even if no verification tool ever ran, which bypasses the existing unverified_write completion gate. Todo convergence is not equivalent to verification, so this reintroduces false-positive acceptance for code changes.
| case EventType.CheckpointRestored: { | ||
| const payload = eventPayload as CheckpointRestoredPayload | undefined | ||
| if (payload) insightStore.addCheckpointEvent(payload) | ||
| chatStore.markAllCheckpointsRestored() |
There was a problem hiding this comment.
This ignores payload.checkpoint_id and marks every available checkpoint in the chat as restored. In a session with multiple checkpoints, restoring one checkpoint will flip unrelated inline marks to 已撤回, and checkpoint_undo_restore later flips all of them back. The update needs to target only the restored checkpoint (and probably the guard checkpoint involved in undo), not the whole message list.
if input.CompletionPassed && verificationGate.Passed { 问题:这没有修复 decider 本身的层级冲突和零门槛问题,而是在 这等于承认 decider
if output.Status == acceptance.AcceptanceContinue && 问题:不是修复 todo 遗留的根因(Run 终止不清理 模型不可能准确判断哪些 todo 属于"上一个任务",这会导致:
这是典型的症状治疗。
旧逻辑(当前 main):
PR 569 新逻辑:
问题:这是方向性错误。我们之前分析指出 现在用户说"修复登录 bug"——旧 stale_todo_reset 只是这个错误决策的事后补救。
if !current.HasPendingAgentTodos && 问题:只要 todo 列表打勾了,未验证的文件写入也视为通过。模型可 |
这个你看看,要不这个PR我直接合,刚好把这些修了 |
主要功能增强
1. Web 端接入思考流展示
ThinkingDelta事件处理,支持模型思考过程的实时流式展示eventBridge.ts中添加思考消息的开始、追加、完成逻辑ChatStore新增startThinkingMessage、appendThinkingChunk、finalizeThinkingMessage方法AgentChunk开始前自动终结,避免与输出消息冲突2. Checkpoint 体验优化
CheckpointInlineMark.tsx组件(283 行改动),增强内联标记的交互和渲染markAllCheckpointsRestored和markAllCheckpointsAvailable方法,支持批量状态更新重要 Bug 修复
3. Verify 死循环修复
todo_run_boundary.go中验证最后 todo 时的死循环问题acceptance_service.go中新增验收服务,完善验证流程VerificationStarted事件处理,当completion_passed=false时跳过创建验证消息4. 文件变更去重
eventBridge.ts中新增normalizeFilePath函数,统一文件路径格式5. 模型错误提示
StopReasonDecided事件中新增fatal_error的错误提示 toast6. Electron 构建修复
electron-builder.config.cjs构建顺序问题其他改进
7. Todo 重写规则增强
todo_run_boundary_test.go测试覆盖8. 输出渲染优化
MarkdownContent.tsx的渲染逻辑(72 行改动)CodeBlock.tsx的代码块展示9. 协议与状态管理
protocol.ts新增事件类型定义useChatStore.ts新增 105 行状态管理逻辑useSessionStore.ts优化会话状态处理改动统计
internal/runtime/和web/src/两个核心目录测试覆盖
todo_run_boundary_test.go,确保验证逻辑的正确性