fix(multi): 子 agent/worker 的事件与 usage 被 NullSink 吞掉——父会话里 worker 是黑盒且成本系统性低估
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- ai-infra-agents
Research direction
Start in src/tools/agent.rs: read build_worker_runtime (~596-607) alongside the builder's default in src/runtime/builder.rs:90,265 to see that no event_sink or storage is ever attached, then follow run_worker (~641-683) and the background append_output path (~757-770) to see where outcome.usage/llm_latency_ms are dropped. Done means a worker runtime wired to a CompositeSink carrying a worker_id/task_id prefix, and worker usage folded back into the parent session's cost accounting; runtime visibility of that flow still needs Langfuse (#124), so acceptance here is diff-level per point.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无 · 验收:代码 diff 逐点核对;运行时可见性另需 Langfuse(#124)
基线 origin/main = fc29f3d4。
Summary
src/tools/agent.rs:596-607(build_worker_runtime)只设 llm/tools/max_steps/system_prompt/wall_timeout,不调.event_sink→ builder 默认 NullSink(runtime/builder.rs:90,265)。run_worker只取outcome.final_text/finish_label(agent.rs:641-683);outcome.usage生产代码无消费者;后台 worker 仅 append_output 纯文本(agent.rs:757-770);worker builder 也不注 storage → 用量无处落盘。
影响
parallel/团队 worker 卡在第几步、跑多久、烧多少 token,父侧(TUI/SSE/成本面板)全不可见;成本统计只算主 agent。#106 闭环了状态持久化,不含事件/用量回流。
建议
worker 运行时挂 CompositeSink(父 sink + worker_id/task_id 前缀);RuntimeOutcome.usage/llm_latency_ms 回注父会话 Usage/成本。
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/recursive
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jeffkit/recursive#134 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
jeffkit/recursive#131 · 1 comment ·
Maintainers usually reply within 1 day
All issues in jeffkit/recursive
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
check: a failed re-read of the model file before binding is labelled E_THETA_LEVEL_BINDING on [parameters]Possibly taken @TeunP claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Devolutions/picky-rs#546 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day