fix(coding-agents): inherit opt-in across worktrees - #3471
Open
altaywtf wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the coding-agents integration so optInOnly and mapPathToBank treat linked Git worktrees as inheriting approval/mapping from their main checkout (when resolveWorktrees is enabled), preventing the MCP server/hooks from staying inert in external worktrees.
Changes:
- Add “current directory then main checkout root” candidate ordering for opt-in and
mapPathToBanklookups, preserving explicit worktree overrides. - Add Vitest coverage for approval/mapping inheritance, explicit overrides, denial, and
resolveWorktrees: false. - Update integration docs (README + docs site + generated reference) to describe the new worktree inheritance semantics.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| skills/hindsight-docs/references/sdks/integrations/coding-agents.md | Regenerated reference docs reflecting worktree inheritance semantics and formatting adjustments. |
| hindsight-integrations/coding-agents/src/core/opt-in.test.ts | Adds tests covering opt-in/mapping inheritance across linked worktrees and the resolveWorktrees toggle. |
| hindsight-integrations/coding-agents/src/core/bank.ts | Implements worktree-aware opt-in and mapping candidate resolution and applies it to isOptedIn/deriveBankId. |
| hindsight-integrations/coding-agents/README.md | Documents opt-in/mapping/worktree inheritance behavior for the integration. |
| hindsight-docs/docs-integrations/coding-agents.md | Mirrors the README doc updates in the docs site page. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
altaywtf
force-pushed
the
fix/coding-agents-worktree-opt-in
branch
from
August 15, 2026 12:48
401a144 to
6ba361a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
optInOnlywork for linked Git worktrees outside an approved checkout path. Resolution checks the literal worktree first, then its main checkout; explicit worktree mappings still win, andresolveWorktrees: falsekeeps inheritance disabled.Risk
One bounded Git lookup is added during approval and bank resolution. Unapproved repositories remain inert.
Verification