Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#118 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

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.

Written by the indexing model from the issue text.

Description

场景 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 渲染显示。

Dominant language
Rust
Stars
4
Forks
0
Avg merge
5h 32m
Merged PRs (30d)
7

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jeffkit/recursive

All issues in jeffkit/recursive

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.