fix(cli): 失败出口主动误导机器消费者——`--output-format json` 全零值信封、`resume` 连 result 行都不发、错误里无 trace id
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start at crates/recursive-cli/src/main.rs:2605-2622, where the error envelope is finished with TokenUsage::default() and zero counters, then see cli/output.rs:435-439, where Single mode drains events instead of feeding the emitter. Cross-check claude_json.rs:394-440 (the envelope consumers receive), resume.rs:646 (the ? that skips printer finish) and openai.rs:185-188 (no WARN, no trace id). Done: a failed --output-format json run reports real partial usage/steps, resume always emits a result line, and Error::Llm carries provider/model plus a header trace id. Blocked on #110/#115.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P0 · 依赖:depends-on: #110、depends-on: #115(未终态时 keeper 自动 hold) · 验收:代码 diff 逐点核对;运行时可见性另需 Langfuse(#124)
基线 origin/main = fc29f3d4。
Summary
crates/recursive-cli/src/main.rs:2605-2622:错误信封task.finish(&reason, None, TokenUsage::default(), 0, 0, ...)——硬编码零值;cli/output.rs:435-439的Self::Single模式下 emitter 从不被喂事件(drain 只丢弃)→build_result(finish, None, TokenUsage::default(), 0, 0)。claude_json.rs:394-440:于是--output-format json(正是代理/flow 的执行模式)在失败时输出{"num_turns":0,"total_cost_usd":0.0,"usage":{all zeros},"stop_reason":"provider_stop:<全文>"}——唯一有信息的是 stop_reason。resume.rs:646的?使 printer 永不 finish——一条 result 行都不发(stream-json 消费者挂死在"等 result";Claude SDK 契约违反,run_once 修过、resume 未修)。- trace id 全缺:全仓 grep
x-request-id|traceparent0 命中;Error::Llm把 model 塞进provider字段;429 重试耗尽后无 WARN(openai.rs:185-188仅 transient 时 warn);Error::RateLimited只有测试构造。
建议
Err 路径透传已知 steps/usage(RuntimeOutcome 已有——让 kernel 在 Err 时也带 partial outcome);resume 补 result 兜底;Error::Llm 加 provider/model 字段并提取响应头 trace id。
- 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 5/5 Over a week Newbie friendliness 20/100
jeffkit/recursive#134 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
jeffkit/recursive#132 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
jeffkit/recursive#88 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
jeffkit/recursive#87 · 11 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
jeffkit/recursive#86 · 6 comments ·
Maintainers usually reply within 1 day
All issues in jeffkit/recursive
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bmander/geomsolver#118 ·
Maintainers usually reply within 1 day
-
Three Windows builds are keyed on a later release than their layoutPossibly taken @ero-qt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Markdown Preview Fonts Don't Show Selected OptionPossibly taken @RadhiRasho claimed this today. Openstate:needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
zed-industries/zed#65300 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day