Skip to content

feat: SSE close fix, auto-compaction status, undo/redo buttons, tool copy, build fix - #740

Open
jokinas wants to merge 5 commits into
agegr:mainfrom
jokinas:feature/local-fixes
Open

feat: SSE close fix, auto-compaction status, undo/redo buttons, tool copy, build fix#740
jokinas wants to merge 5 commits into
agegr:mainfrom
jokinas:feature/local-fixes

Conversation

@jokinas

@jokinas jokinas commented Sep 6, 2026

Copy link
Copy Markdown

feat: SSE连接修复、自动压缩状态显示、撤销/重做按钮、工具复制、构建修复

修改内容

SSE 连接修复

  • 修复 agent-event-connection.tsclose() 方法,使用 succeed() 替代 reject,防止正常关闭连接时产生 AgentEventConnectionError 报错

自动压缩状态显示

  • AgentPhase 类型中新增 compacting 状态,区分自动压缩与手动压缩
  • 自动压缩时显示"正在自动压缩",手动压缩时显示"正在压缩"
  • 修复此前自动压缩时前端一直显示"正在等候模型",无法区分是否在处理自动压缩的问题

撤销/重做/检查点按钮

  • 在聊天输入框底部工具栏添加撤销、重做、检查点三个按钮
  • 按钮通过 handleSend 调用 pi-workspace-history 插件的斜杠命令(/undo/redo/checkpoint

工具调用复制按钮

  • 在 ToolCallBlock 头部下拉箭头左侧添加复制按钮
  • 点击复制工具输入的命令(block.input.command),而非工具的回复内容

React 重复 Key 修复

  • 修复 CompactionFileList 的重复 key 警告,使用 Array.from(new Set(files)) 对文件路径去重

CSS 导入修复

  • @xterm/xterm/css/xterm.cssglobals.css@import 移至 layout.tsx 的 JS import
  • Tailwind v4 的 PostCSS 处理器无法解析 CSS @import 中的 bare module 路径

生产构建修复

  • next.config.ts 中添加 outputFileTracingExcludes,排除 UPPS 路径
  • 修复 Windows 上 next buildEPERM 错误

翻译

  • 新增中文和英文翻译:chat.autoCompactingchat.undochat.redochat.checkpoint

feat: SSE close fix, auto-compaction status, undo/redo buttons, tool copy, build fix

Changes

SSE Connection Fix

  • Fix agent-event-connection.ts close() to use succeed() instead of reject, preventing spurious AgentEventConnectionError on normal connection shutdown

Auto-Compaction Status

  • Add compacting state to AgentPhase type to distinguish auto-compaction from manual compaction
  • Display "正在自动压缩" (Auto-compacting) during auto compaction, "正在压缩" (Compacting) during manual compaction
  • Previously the UI showed "Waiting for model" during auto-compaction, making it indistinguishable from actual model wait

Undo / Redo / Checkpoint Buttons

  • Add undo, redo, and checkpoint toolbar buttons to ChatInput
  • Buttons invoke pi-workspace-history slash commands (/undo, /redo, /checkpoint) via handleSend

Tool Call Copy Button

  • Add a copy button to the ToolCallBlock header (left of the expand arrow)
  • Copies the tool's input command (block.input.command), not the tool result

React Duplicate Key Fix

  • Fix CompactionFileList duplicate key warning by deduplicating file paths with Array.from(new Set(files))

CSS Import Fix

  • Move @xterm/xterm/css/xterm.css from globals.css to layout.tsx JS import
  • Tailwind v4 PostCSS processor cannot resolve bare module paths in CSS @import

Production Build Fix

  • Add outputFileTracingExcludes for UPPS path to fix EPERM error during next build on Windows

Translations

  • Add zh-CN and en translations for chat.autoCompacting, chat.undo, chat.redo, chat.checkpoint

Administrator added 4 commits September 6, 2026 20:01
…copy, build fix

Fix agent-event-connection close() to prevent errors on shutdown; Add compacting AgentPhase for auto/manual compaction distinction; Add undo/redo/checkpoint buttons using pi-workspace-history; Add copy button to ToolCallBlock header; Fix React duplicate key in CompactionFileList; Move xterm CSS import to layout.tsx; Add outputFileTracingExcludes for build EPERM fix
Deduplicate ancestor messages when active branch changes during pagination request; Add 'i' prefix to numeric fallback keys to avoid React key collisions
@jokinas jokinas changed the title feat: SSE连接修复、自动压缩状态显示、撤销/重做按钮、工具复制、构建修复 feat: SSE close fix, auto-compaction status, undo/redo buttons, tool copy, build fix feat: SSE close fix, auto-compaction status, undo/redo buttons, tool copy, build fix Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant