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

fix(cli): run/resume 的错误路径跳过会话 finalize——55% 的 `.meta.json` 永远停在 `active`,"尸体"与"在跑"不可分

Open
#110 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
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

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 遵守。
  • 实测本机:~/.recursive 1132 个 .meta.json 中 active 626 个(55%)vs crashed 仅 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

  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.