fix(events): 工具耗时算完即丢,SSE `tool_progress` 用批次墙钟冒充单工具耗时(同批同数字、还含审批等待)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start at run_core.rs:1227-1228 and :1293, where duration_ms is computed but only fed to the PostToolCall hook, and at the ToolResult event definition in src/event.rs:41-52. Add duration_ms to ToolResult, populate it at those two sites, and have the SSE handler at handlers.rs:1204-1227 forward it rather than subtracting ToolCall from ToolResult. Finish by rendering it in crates/recursive-tui/src/model.rs:117-123. Done when each tool in a batch reports its own duration and the TuiPermissionHook approval wait (backend.rs:328-359) is excluded.
由索引模型根据 Issue 内容生成。
描述
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无 · 验收:代码 diff 逐点核对;运行时可见性另需 Langfuse(#124)
基线 origin/main = fc29f3d4。
Summary
duration_ms在run_core.rs:1227-1228(并行)/:1293(串行)算好后只喂 PostToolCall hook;ToolCallOutcome无该字段;ToolResult事件无耗时(src/event.rs:41-52字段:id/name/output/step/is_error)。- 所有
ToolResult在整批execute_tool_calls返回后统一发射(run_core.rs:1429-1430)→ HTTP 侧用 ToolCall→ToolResult 差值算 elapsed(handlers.rs:1204-1227):同批所有工具显示同一个数字,且包含TuiPermissionHook的人工审批等待(backend.rs:328-359批内阻塞)。TUI 的 ToolCall block 也无 duration(crates/recursive-tui/src/model.rs:117-123)。
影响
"哪个工具慢、慢在排队还是执行、人审批占了多少"——三个值班问题一个都答不了;tool_progress 数字会误导归因。
建议
ToolResult 补 duration_ms(有条件再补 queue/approval 分段);SSE 直接转发不重算;TUI 渲染显示。
- 主要语言
- Rust
- 星标
- 4
- 派生
- 0
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 7
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jeffkit/recursive 的其他 Issue
-
难度 3/5 半天 新手友好度 72/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
jeffkit/recursive#141 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 66/100
jeffkit/recursive#138 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
jeffkit/recursive#134 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
维护者通常 1 天内回复
查看 jeffkit/recursive 的全部 Issue
相似的 Issue
-
feature request good first issue
难度 2/5 1-3 小时 新手友好度 85/100
TabularisDB/tabularis#853 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
andrewdavidmackenzie/jonesy#267 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 4 天内回复
-
`future_into_py` loses the original panic message可能已有人在做 @Danipulok 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
PyO3/pyo3-async-runtimes#91 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复