feat(checkpoint): 回退点迁移到用户气泡行内按钮(对齐 Claude Code) - #524
Merged
Conversation
右上角 History 下拉菜单移除,每条用户消息下新增行内 Undo 按钮作为回退点; WebUI 同步获得回退能力(此前 P2 缺口)。 - turnId 改为用户消息 ID:发送管线经 checkpoint_begin_turn 写入 kind:"turn" 边界记录,零文件轮也是合法回退点;行内按钮按 messageRef.messageId 命中该轮 - 共享真源 agent-ui/lib/chat/checkpointRewind.tsx:Provider(确认弹窗/预览/ TOCTOU expected 回传/结果提示)+ useCheckpointRewindAction;回调走 latest-ref 防流式期间全量用户行重渲染,列表加载带 epoch 防慢响应乱序,切会话即清空 - 按钮渲染内聚共享 TranscriptUserMessageActions,调用方只传 rewindTurnId; 回退完成通知文案单一真源 formatCheckpointRewoundNotification(零计数不展示、 NBSP 钉住数字量词、问题项收进括号尾注) - WebUI 通道:proto CheckpointRequest/Response 直通臂(GatewayEnvelope 98 / AgentEnvelope 103),guard vetCheckpoint 按 action 分档校验,桌面端 gateway_bridge 复用同一批 checkpoint 命令 - 桌面传输层 CheckpointRewindMenu.tsx 重命名为 DesktopCheckpointRewindProvider.tsx 测试:Rust checkpoint 42 通过(新增 turn 边界 3 例)、Go guard 通过、 web 587 / GUI 1909 通过、两端 tsc/biome 干净。 Closes #523
StackCairn
marked this pull request as draft
August 17, 2026 07:07
Contributor
|
PR governance checks passed. Awaiting human review. |
su-fen
marked this pull request as ready for review
August 17, 2026 07:22
StackCairn
marked this pull request as draft
August 17, 2026 07:22
su-fen
marked this pull request as ready for review
August 17, 2026 07:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #523
概要
代码回退入口从聊天页右上角 History 下拉菜单迁移到每个用户气泡下的行内 Undo 按钮,对齐 Claude Code 的每消息回退交互;WebUI 同步打通该能力(此前 P2 缺口)。
变更
身份链:turnId = 用户消息 ID
useSendChatTurn发送时调用新命令checkpoint_begin_turn,以pendingUserMessage.id写入kind:"turn"轮次边界记录,并经checkpointTurnId传入runAgentConversationTurn(缺失才回退crypto.randomUUID())。file_count>0过滤已删除。messageRef.messageId命中该轮检查点。共享真源
agent-ui/lib/chat/checkpointRewind.tsxCheckpointRewindProvider:确认弹窗、预览统计、TOCTOU expected 回传、错误/部分完成提示全部集中于此;两端只注入各自的CheckpointRewindClient传输层。TranscriptUserMessageActions,调用方只传rewindTurnId。formatCheckpointRewoundNotification:零计数不展示、NBSP 钉住数字与量词防折行、问题项收进括号尾注、英文单复数修正。WebUI 通道
CheckpointRequest(GatewayEnvelope 98)/CheckpointResponse(AgentEnvelope 103,result_json直通)。vetCheckpoint按 action 分档校验(list 禁带 turn_seq/roots/expected;diff/rewind 必带 turn_seq;roots ≤64、expected ≤10000)。gateway_bridge::handle_checkpoint复用同一批 checkpoint 命令;响应经AwaitUnaryResponse原样中继,Go 侧零额外接线。activeWorkspaceProjectPath === displayedConversationWorkdir时附加 active/write grants。其他
CheckpointRewindMenu.tsx→DesktopCheckpointRewindProvider.tsx(git mv,名实一致)。chat.rewindCode/chat.rewindUnavailable。测试
tsc --noEmit与 biome 干净;check-ui-boundaries通过Screenshots / preview
已知边界