优化: 对话执行轨迹聚合与工具卡交互

前端聚合当前轮次工具调用数,替代每轮清零的完成计数,进度文案改轮次+累计口径
完成聚合语义由执行轨迹卡承接,工具卡复读修复与默认折叠收敛
流式与工具事件配套调整,新增轮次轨迹收集 composable
This commit is contained in:
lxy
2026-10-01 02:41:05 +08:00
parent e7cd035c62
commit 04acc4297d
15 changed files with 482 additions and 95 deletions
+20 -5
View File
@@ -52,10 +52,25 @@ export default {
unarchiveAction: 'unarchive',
pinAction: 'pin',
unpinAction: 'unpin',
// Agentic loop progress bar copy
// Note: max round / completed tool count are not surfaced by backend this round;
// template conditionally omits them. Add *WithMax keys once backend exposes them.
agenticProgress: '🔄 Round {round} · ⏳{pending} pending',
agenticProgressNoPending: '🔄 Round {round} · ✅{completed} tools done',
// Agentic loop progress bar copy (status semantics: round N · M calls total · running/pending)
// total is aggregated on the frontend from current-turn toolCalls (useTurnTrace), not a backend field
// Note: max round is not surfaced by backend; template conditionally omits it.
agenticProgress: 'Round {round} · {total} calls total · ⏳{pending} pending',
agenticProgressNoPending: 'Round {round} · {total} calls total · running',
// Shared semantics for execution trace card / live step summary (A) and aggregate group row (B)
trace: {
title: 'Execution Trace',
calls: '{n} calls',
ok: '{n} ok',
fail: '{n} failed',
rejected: '{n} rejected',
duration: 'total {time}',
expand: 'Expand trace',
collapse: 'Collapse trace',
processOnly: 'Process log',
stepDone: '✓ {n} calls done',
stepRunning: 'running {name}',
stepPending: '⏳ {n} pending approval',
},
},
}
+1 -1
View File
@@ -190,7 +190,7 @@ export default {
// M5:path deny second confirmation (deny is irreversible — tool returns Err, loop continues without retry; asymmetry with approve, prevents mis-clicks)
dirAuthDenyConfirm: 'Deny authorization? The tool will fail immediately and will not be retried this round.',
// Persistent bypass banner shown at the top of the chat area while "trust all directories" is on
pathAuthBypassBanner: 'Authorization bypassed: AI can access files directly',
pathAuthBypassBanner: 'Authorization fully bypassed (including sensitive directories): AI can access any file directly',
// ── Input Augmentation layer: mention/skill injection feedback ──
// search_files blind search denied by whitelist fallback (no auth dialog; prompt user to use @mention or absolute path)
+20 -4
View File
@@ -52,9 +52,25 @@ export default {
unarchiveAction: '取消归档',
pinAction: '置顶',
unpinAction: '取消置顶',
// Agentic 循环进度条文案
// 注:max 轮次/已完成工具数本轮后端暂不透传,模板条件渲染省略;后端补全后新增 *WithMax key
agenticProgress: '🔄 循环 {round} · ⏳{pending}待审批',
agenticProgressNoPending: '🔄 循环 {round} · ✅{completed}个工具完成',
// Agentic 循环进度条文案(C 状态语义化:第 N 轮 · 累计 M 次调用 · 进行中/待审批)
// total 由前端聚合当前轮次 toolCalls(useTurnTrace),非后端字段
// 注:max 总轮次后端暂不透传,模板条件渲染省略;后端补全后新增 *WithMax key
agenticProgress: '第 {round} 轮 · 累计 {total} 次调用 · ⏳{pending} 项待审批',
agenticProgressNoPending: '第 {round} 轮 · 累计 {total} 次调用 · 进行中',
// 执行轨迹卡/实时步骤摘要(A 过程压缩)与聚合分组行(B 聚合卡统一)共用语义
trace: {
title: '执行轨迹',
calls: '{n} 次调用',
ok: '成功 {n}',
fail: '失败 {n}',
rejected: '拒绝 {n}',
duration: '总耗时 {time}',
expand: '展开轨迹',
collapse: '收起轨迹',
processOnly: '过程记录',
stepDone: '✓ {n} 次调用完成',
stepRunning: '正在 {name}',
stepPending: '⏳ {n} 项待审批',
},
},
}
+1 -1
View File
@@ -191,7 +191,7 @@ export default {
// M5:path 类拒绝二次确认(拒绝不可逆——工具返 Err、loop 续跑不再重试,与 approve 不对称,防误点)
dirAuthDenyConfirm: '确定拒绝授权吗?该工具将立即失败,且本轮不会重试。',
// 「信任所有目录」总开关开启期间的常驻放行横幅(对话区顶部)
pathAuthBypassBanner: '授权已放行:AI 可直接访问文件',
pathAuthBypassBanner: '授权已完全放行(含敏感目录):AI 可直接访问任意文件',
// ── Input Augmentation 层: mention/skill 注入反馈 ──
// search_files 盲搜被白名单兜底拒绝(不应弹授权窗,直接友好提示用户改用 @引用或绝对路径)