Repository navigation
Description
Repro
git worktree add ../wt -b test
# index both the main checkout and ../wt separately
Pipe a PreToolUse payload into hook-augment, varying only the payload's cwd field (process cwd held constant, deadline raised to 8000ms to rule out #1335):
| process cwd | payload cwd |
bytes |
|---|---|---|
| main | main | 663 |
| main | worktree | 0 |
| worktree | main | 663 |
| worktree | worktree | 0 |
The payload's cwd alone decides the outcome; the process's own cwd is irrelevant.
Expected
A payload whose cwd is an indexed linked worktree should return that worktree's own project context — the worktree has its own full index (confirmed via index_status, is_worktree=true, resolving canonical_root back to the main checkout's .git), and search_graph against the worktree's project directly returns correct, non-stale results.
Actual
Empty output (exit 0, nothing on stderr, hook-augment-timeouts.log unaffected) at both the default 2s deadline and an 8s deadline — this is not the deadline/fingerprint issue in #1335, it's a clean no-output path with its own project already indexed.
Notes
index_status already resolves worktree paths correctly (is_worktree, git_common_dir, canonical_root) — the hook's own cwd → project resolution appears not to use that same logic, so an indexed linked worktree's payload cwd fails to resolve to its project. Distinct from #1335 (that's a timeout under the SHA-256 fingerprint cost); this is a resolution defect independent of timing.
Happy to share the full measurement writeup if useful.
Activity
DeusData commentedon Aug 20, 2026
Thanks for the careful reproduction and for separating this from the timeout case — that distinction is genuinely helpful.
I traced this on current main. With both the main checkout and linked worktree indexed under their path-derived project names, the hook should probe the linked worktree project directly before any registry fallback. I could not derive an honest failing test from the current snapshot, so could you please share the following (local usernames and paths may be redacted consistently):
list_projectsentries for both checkouts, including project name androot_path;cwdfield in the hook payload;tool_nameandtool_input.pattern;search_grapharguments that succeed;CBM_CACHE_DIR.Those values will let us distinguish project-key mismatch, payload routing, and environment mismatch and turn this into a deterministic regression. Thank you again.
github-actions commentedon Aug 20, 2026
Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:
codebase-memory-mcp --versionyou're onOnce that's here we'll pick it straight back up. Heads-up: issues left
awaiting-reporterare automatically closed after a few weeks of silence, but a comment reopens the door anytime.bmcnaboe commentedon Sep 3, 2026
Reporter follow-up: the 0-byte case above was measured on v0.10.5. Re-testing on v0.10.8-based
mainwith two real linked worktrees off the same repo, it no longer reproduces — a payloadcwdinside the indexed worktree (or a subdirectory of it) resolves to that worktree's own project, an unindexed worktree gets the explicit "no indexed graph project matched" notice rather than 0 bytes, and the main checkout is unchanged. Same binary andCBM_CACHE_DIRfor the hook and the direct query.So this was fixed somewhere between v0.10.5 and v0.10.8; #1768 pins the behaviour as regression tests on top of
main. Fine to close this as not reproducible on current versions — #1768 stands on its own.DeusData commentedon Sep 3, 2026
Thank you for re-testing this against the v0.10.8-based
mainand for reporting that the original zero-byte behavior no longer reproduces.I have removed
awaiting-reporter. Since indexed linked-worktree paths now resolve to their own project and unindexed worktrees return an explicit no-match result, the reported defect is resolved on current versions. PR #1768 remains the regression-test record for that contract.Closing this as completed. Thank you for coming back with the decisive retest instead of leaving the old-version result ambiguous.
test(hook-augment): pin worktree payload-cwd resolution
test(hook-augment): pin worktree payload-cwd resolution
test(hook-augment): pin worktree payload-cwd resolution