Skip to content

fix(skills): remove all existing code-review-graph hook entries on reinstall (#558) - #836

Open
Blazehue wants to merge 2 commits into
tirth8205:mainfrom
Blazehue:fix/hooks-incremental-flow-paths
Open

fix(skills): remove all existing code-review-graph hook entries on reinstall (#558)#836
Blazehue wants to merge 2 commits into
tirth8205:mainfrom
Blazehue:fix/hooks-incremental-flow-paths

Conversation

@Blazehue

@Blazehue Blazehue commented Aug 8, 2026

Copy link
Copy Markdown

I'll update #558 for the same:

Summary

  • Updated _merge_hooks_into_settings in code_review_graph/skills.py to filter out all existing code-review-graph hook entries before appending the new dynamic hook config. This purges stale absolute-path entries and accumulated duplicate hooks on re-installation.
  • Added test_install_hooks_replaces_old_and_duplicate_hooks in tests/test_skills.py seeding an old-style absolute-path hook and duplicate entries, asserting that custom user hooks are preserved while all old CRG entries are replaced by a single dynamic git rev-parse hook.

Verification

  • Tested with pytest tests/test_skills.py (192 passed).

@tirth8205

Copy link
Copy Markdown
Owner

Thanks. Two parts.

The flows change does not fix #569 in the scenario the issue describes. os.path.abspath and Path.resolve at flows.py:489-497 resolve against the process cwd, not the repo root, and incremental_trace_flows never receives the root (tools/build.py:164 has it and does not pass it). Run the MCP server or daemon with cwd outside the repo and the new entry point is still missed. Your test only passes because pytest runs from the repo root. #673 threads repo_root through properly, so I will take that for flows. Please drop the flows.py and test_flows.py hunks.

The hooks dedup is worth keeping, with two changes. Remove all existing code-review-graph entries instead of only the first (skills.py:1041-1046 breaks after one match), otherwise users who already accumulated duplicates keep the stale ones. And the regression test passes on main unchanged, since identical reinstalls were already deduped. Seed an old-style absolute-path hook and assert it is replaced.

#576 is already fixed on main and closed, so drop it from the description.

@Blazehue
Blazehue force-pushed the fix/hooks-incremental-flow-paths branch from 6c733eb to 059f559 Compare August 22, 2026 02:42
@Blazehue Blazehue changed the title fix(hooks,flows): prevent duplicate hooks on reinstall and resolve relative vs absolute path mismatch (#558, #569, #576) fix(skills): remove all existing code-review-graph hook entries on reinstall (#558) Aug 22, 2026
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.

2 participants