dashboard session_count disagrees with recall_repo for sessions launched from parent dir #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-12T07:57:19Z - https://github.com/coilysiren/repo-recall/issues/90
Observed
For repo coilyco-ai (id 21):
Same scan, same repo, two answers.
Hypothesis
The dashboard's per-repo `session_count` comes from `finalize_repo_aggregates` at the end of refresh (per AGENTS.md). The per-repo detail view (`recall_repo`) reads the `session_repos` join table directly.
The `session_repos.match_type = 'cwd'` join uses longest-prefix-wins (per `join.rs` MVP note). When a session's cwd is `/home/kai/projects/coilysiren` (the parent dir containing all 25 sub-repos), no single sub-repo path is a prefix of that cwd, so the strict longest-prefix join attaches no row. But the per-repo detail call seems to fire on a looser "is this repo a child of this session's cwd" relation, which catches the parent-cwd case.
Net effect: every Claude Code session launched from the workspace parent dir vanishes from the dashboard's per-repo counts while still showing in the per-repo detail view.
Repro
```
mcporter call repo-recall recall_dashboard | jq '.repos[] | select(.id==21).session_count'
-> 0
mcporter call repo-recall recall_repo --arg repo_id 21 | jq '.sessions | length'
-> 5
```
(Session cwds in the second result are all `/home/kai/projects/coilysiren`.)
Suggested fix
Pick one source of truth. Either:
Per AGENTS.md ("`session_repos.match_type` is the extension point"), the second option fits the design intent. Add a new `match_type = 'parent_cwd'` row for the ancestor case, and have both the precompute and the detail view count both types.