Skip to content

fix(digest): enable usage reporting for project scope#111

Merged
jeff-r2026 merged 1 commit into
mainfrom
worktree-fix-project-scope-usage-report
Jul 2, 2026
Merged

fix(digest): enable usage reporting for project scope#111
jeff-r2026 merged 1 commit into
mainfrom
worktree-fix-project-scope-usage-report

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Summary

  • Project scope 下 teamai digest 始终显示 "No team usage data available",因为 usage 数据只上报到 user scope 的 team repo
  • 将 usage 上报从 pullForScope() 提升到 pull() 主函数,统一向所有 active scope 的 repo 上报
  • 添加 skipTruncate 选项避免共享的 usage.jsonl 被提前截断
  • 修复 teamai stats 在 project scope 下无法读取已上报数据
  • 让 skill recommendations 对 project scope 也生效

Test plan

  • npx tsc --noEmit 通过
  • npx vitest run 通过(2 个预先存在的 import-repo 失败无关)
  • 在有 project scope 配置的目录执行 teamai pull,确认 stats 上报到 project team repo
  • 执行 teamai digest,确认不再显示 "No team usage data available"
  • 执行 teamai stats,确认能读取 project repo 的已上报统计

🤖 Generated with Claude Code

The shared usage data (~/.teamai/usage.jsonl) was only reported to the
user-scope team repo during `teamai pull`. Projects with their own
team repo never received stats, causing `teamai digest` to always show
"No team usage data available" in project scope.

Fix by:
- Moving usage reporting from pullForScope() to the top-level pull(),
  reporting to all active scopes before truncating the shared events.
- Adding skipTruncate option to reportUsageToTeam() so events survive
  across multiple repo targets.
- Fixing `teamai stats` to resolve project-scope config when loading
  reported stats.
- Enabling skill recommendations for project scope.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeff-r2026 jeff-r2026 merged commit f664775 into main Jul 2, 2026
5 of 6 checks passed
@jeff-r2026 jeff-r2026 deleted the worktree-fix-project-scope-usage-report branch July 2, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant