cli: opencode stats reports no tool calls when all calls are still running

未关闭 适合新手
#64,631 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
bun, typescript
领域
cli

调研方向

首先追踪 opencode stats 的默认卡片,并比较它与详细视图和 JSON 视图统计调用次数的方式;有效负载未指定源文件或测试。通过一个未完成的工具调用复现,并检查卡片是否报告一次调用,同时成功率仍不可用;然后确认在任何调用发生前,它仍报告没有调用,而调用完成后则报告成功率为 100.0%。

由索引模型根据 Issue 内容生成。

描述

area/cli platform/windows type/bug version/v2
Description

When the only tool call in the selected range is still running, the default opencode stats card says no tool calls. The detailed and JSON views correctly count that call. A success rate is not available yet, but that is different from zero calls.

Steps to reproduce
  1. Use a fresh project that has a single pending tool call, for example a question waiting for a reply, and no completed or failed calls in the range.
  2. Before the call finishes, compare opencode stats --project . --days 1, the same command with --tools, and with --json.
  3. The card says no tool calls; the detail view says 0 finished calls · 1 unfinished; JSON reports calls: 1 and unfinished: 1.

Verified with the production Core projector and stats collector in an in-memory database. A loopback fixture replayed their outputs to the unmodified CLI, which printed the same discrepancy in 3/3 runs. Controls: before the call the card correctly reported no calls; after successful completion it reported 100.0% tool success. No live provider or user database was involved.

OpenCode version

V2 dev at 22377659a8ed223f3eebc86660dd1a5bc2b33ca5 (2.3.0).

Operating System

Windows 11 x64, Bun 1.4.4.

Terminal

CLI subprocess with captured stdout; no TUI or third-party plugins.

主要语言
TypeScript
星标
227k
派生
30.7k
平均合并
4 小时 35 分钟
30 天内合并 PR
498

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。