fix(cli): run/resume 的错误路径跳过会话 finalize——55% 的 `.meta.json` 永远停在 `active`,"尸体"与"在跑"不可分
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Read crates/recursive-cli/src/main.rs around the run_result Err branch (2600-2627) and compare it with the loop path at 2240-2247 and the finalize calls at 2675-2676; src/session/writer.rs:522-555 shows finish() is the only writer of status/cost. Then look at cli/resume.rs:646, where the ? skips finalize. Done means a forced provider failure leaves .meta.json with status=crashed, an error field, and cost.json written; note the dependency on #111.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P0 · 依赖:depends-on: #111(未终态时 keeper 自动 hold) · 验收:代码 diff 逐点核对;运行时可见性另需 Langfuse(#124)
基线 origin/main = fc29f3d4。
Summary
crates/recursive-cli/src/main.rs:2600-2627:run_result的Err分支只drop(runtime)+ 顶一个错误信封,然后return Err(err)——绕过:2675-2676的finalize_session_writer/finalize_cost_tracker(finish()是唯一写status/cost的地方,src/session/writer.rs:522-555)。crates/recursive-cli/src/cli/resume.rs:646:runtime.run(message.clone()).await?——?直接跳出,:715-716的 finalize 永不执行。- 对照:loop 路径(
main.rs:2240-2247)注释自述不变量 "every run closes its session envelope"——该不变量在run_once里不存在,唯 loop 遵守。 - 实测本机:
~/.recursive1132 个.meta.json中active626 个(55%)vscrashed仅 19;抽查一个死透会话:transcript 尾条是孤儿 tool_call、.lock残留、无cost字段——却与正在跑的会话无法区分。
影响
事故复盘时主管线拿到的 .meta.json 给出错误答案("还在跑");recursive resume 也会把 active 当进行中候选;失败 run 的 cost 归零。
建议
finalize 提到 Err 分支(或 RAII guard:SessionWriter Drop 时未 finish 则按 Crashed+原因落盘);resume.rs:646 同处理。
验收:制造一次 provider 失败,断言 .meta.json status=crashed + 有 error 字段 + cost.json 落盘。
- 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
-
feature request good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
TabularisDB/tabularis#853 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
andrewdavidmackenzie/jonesy#267 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 4 days
-
`future_into_py` loses the original panic messagePossibly taken @Danipulok claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
PyO3/pyo3-async-runtimes#91 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day