Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

fix(events): 工具耗时算完即丢,SSE `tool_progress` 用批次墙钟冒充单工具耗时(同批同数字、还含审批等待)

已关闭
#118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jeffkit/recursive 的其他 Issue

查看 jeffkit/recursive 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。