fix(aidd-telemetry): a session run in a git worktree is missing from every report outside that worktree, and lost when the worktree is removed
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- git, javascript, typescript
- 领域
- cli, observability, tooling
调研方向
Start by reading cli/src/kernel/paths.ts, cli/src/kernel/reading/repository-root.ts, and plugins/aidd-telemetry/hooks/lib/repo.cjs, then review the related issues cited in the proposal. Trace how reports read journals through read-local-cost-use-case.ts and report-cost-use-case.ts. Done means the QA steps pass: reports from any checkout include every worktree, and a removed worktree's session remains visible.
由索引模型根据 Issue 内容生成。
描述
Description
A session run in a git linked worktree is missing from aidd telemetry report run anywhere else, and is lost for good once the worktree is removed.
The hook writes the run journal under the worktree's own aidd_docs/runs/ (git rev-parse --show-toplevel). The CLI reads only the journal of the checkout it runs in, and the sink is filled only from that journal. aidd telemetry on git-ignores aidd_docs/runs/, so git worktree remove deletes the journal with the worktree.
Affected file(s)
cli/src/kernel/paths.ts(resolvedRunsDir)cli/src/kernel/reading/repository-root.ts(repositoryRootAbovestops at the worktree's.gitfile)plugins/aidd-telemetry/hooks/lib/repo.cjs(journal anchored at--show-toplevel)
Expected behaviour
A session run in any worktree of a repository appears in a report run from any checkout of that repository, and still appears after that worktree is removed.
Observed behaviour
One repository, three active worktrees, one Claude Code session each:
| Session | session_start in its worktree journal |
Records in the sink |
|---|---|---|
| A | yes, with worktree_id |
0 |
| B | yes, with worktree_id |
695 (a report was run from B) |
| C | yes, with worktree_id |
0 |
A report from the main checkout sees none of them. Removing the worktree of A or C now leaves no journal to recover their cost from; the transcripts remain but nothing names them.
Proposed solution
- Decide where a worktree's journal lives, or how a report gathers every worktree's journal, and write the decision down. #693 raised this choice; #706 closed it by delivering the
worktree_idfield (#695), and the per-worktree default was kept without a recorded decision. - Whatever is chosen, a journal must outlive
git worktree remove. - A report run from any checkout of a repository counts the sessions of all its worktrees, still told apart by
worktree_id.
Context / Technical constraints
- #693 assumed "sessions from worktree B still contribute their tokens, the sink pools everything, they read as unattributed". That no longer holds: the sink is filled only through the current checkout's journal (
read-local-cost-use-case.ts,report-cost-use-case.tscatch-up), so those sessions are absent, not unattributed. - Committing journals is not an option:
aidd telemetry ongit-ignores them on purpose (telemetry-on-use-case.ts). - Agent runners (Orca, Claude Code under
.claude/worktrees/) give each agent its own worktree, so this is the common case, not an edge case.
Environment
| AI tool | Claude Code 2.1.283 |
| aidd-cli version | 5.4.0 |
| OS | Windows 11 Pro (10.0.26100) |
| node | 24.12.0 |
| aidd-telemetry | 0.2.0 |
QA
- In a repository with telemetry on, create two worktrees and run one session in each.
- From the main checkout, run
aidd telemetry report: both sessions appear, told apart by worktree. git worktree removeone worktree, run the report again: its session still appears.
Relations
| Field | Value |
|---|---|
| parent | #631 |
| related | #693, #695, #657, #707 |
- 主要语言
- TypeScript
- 星标
- 481
- 派生
- 45
- 平均合并
- 18 小时 31 分钟
- 30 天内合并 PR
- 108
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ai-driven-dev/framework 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
ai-driven-dev/framework#940 ·
维护者通常 1 天内回复
-
refactor(aidd-orchestrator): the check zone says when to stop, and reviews its axes in one round未关闭
难度 2/5 1-3 小时 新手友好度 76/100
ai-driven-dev/framework#887 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
ai-driven-dev/framework#873 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
ai-driven-dev/framework#625 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
ai-driven-dev/framework#467 · 1 条评论 ·
维护者通常 1 天内回复
查看 ai-driven-dev/framework 的全部 Issue
相似的 Issue
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/security-dashboards-plugin#2545 ·
维护者通常 1 天内回复
-
Add: Dream TR SD未关闭check:passed streams:add
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
SocialGouv/egapro#4672 · 1 条评论 ·
维护者通常 2 天内回复
-
area:agents area:tui bug
难度 2/5 1-3 小时 新手友好度 74/100
anthropics/claude-code#98358 ·
维护者通常 1 天内回复