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

fix(cli): 失败出口主动误导机器消费者——`--output-format json` 全零值信封、`resume` 连 result 行都不发、错误里无 trace id

Closed
#112 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

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|traceparent 0 命中;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

  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.