feat: Web UI 交互主线 — 文件面板、模型切换、Transcript 安全修复#583
feat: Web UI 交互主线 — 文件面板、模型切换、Transcript 安全修复#583pionxe merged 10 commits into1024XEngineer:mainfrom
Conversation
新增 transcript 工具函数:RepairIncompleteToolCallTail 检测并截断未闭合的 assistant tool_calls 尾部,TrimMessagesToLimitPreservingToolSpans / TrimPrefixCountPreservingToolSpans 保证裁剪不会从 tool span 中间切断。 runtime 层 LoadSession 统一走修复路径,所有内部调用方从直接调用 sessionStore.LoadSession 改为走 Service.LoadSession,确保任何加载入口 都会修复残缺消息链。SQLite 持久层的消息裁剪同步改为安全版本。
在 SelectProviderModel / CreateProvider 调用链中,选择完成后同步 广播到当前所有已加载工作区,将其会话 Head 中的 Provider/Model 元数据更新为新值,避免非管理端口对应工作区的会话滞留旧值, 导致后续 listModels 解析到过期 provider/model。
ModelSelector: 将单会话模型切换改为全局 selectProviderModel 路径, 生成中缓存待切换请求,生成结束后一次性生效。 Sidebar: 新增单元测试覆盖。 FileChangePanel / FileTreePanel / GitDiffPreviewEditor: 强化交互联动 与视觉一致性。 index.css: 补充布局与过渡样式。 useWorkspaceStore: 补全状态联动字段。
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| @@ -214,6 +224,29 @@ export default function FileTreePanel() { | |||
| } | |||
There was a problem hiding this comment.
loadRoot and the surrounding state here are only keyed off gatewayAPI, so after switchWorkspace() the mounted file tree keeps the previous workspace's rootNodes/dirCache. The preview tabs are reset on workspace switch, but the tree itself is not, which means the panel can keep showing files from the old workspace until it is remounted or manually refreshed.
| const now = Date.now() | ||
| const diff = now - d.getTime() | ||
| const sec = Math.floor(diff / 1000) | ||
| if (sec < 60) return '鍒氬垰' |
There was a problem hiding this comment.
This introduces mojibake into a user-facing label: the function now returns 鍒氬垰 instead of 刚刚, and the new comment on relativeTime is also garbled. Since Sidebar renders this helper directly, users will see broken text in the session list.
| return gateway.ProviderSelectionResult{}, err | ||
| } | ||
| } | ||
| if err := b.SyncSessionsProviderModel(ctx, selection.ProviderID, selection.ModelID); err != nil { |
There was a problem hiding this comment.
At this point the global provider/model selection has already been persisted, so any failure inside SyncSessionsProviderModel turns the RPC into an error after the config changed. That leaves the frontend thinking the switch failed while the backend has partially applied it, and a single unreadable/stale session can block future switches. This fan-out needs rollback or best-effort handling instead of failing the whole request after the mutation.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
概述
本 PR 完成 Web UI 核心交互主线,包含三个代码预览与 Git Diff 面板、
模型选择器全局切换、以及 Runtime 层 transcript 安全加固。
变更内容
Web 前端
selectProviderModel路径,生成中缓存请求,结束后一次性应用Gateway 层
Runtime 层
tool_calls尾部,避免向 provider 发送非法消息链Service.LoadSession,确保修复路径全覆盖Repository 层
修复
文件统计
71 files changed, 7,444 insertions(+), 3,009 deletions(-)