Skip to content

fix(coding-agents): inherit opt-in across worktrees - #3471

Open
altaywtf wants to merge 3 commits into
vectorize-io:mainfrom
uinaf:fix/coding-agents-worktree-opt-in
Open

fix(coding-agents): inherit opt-in across worktrees#3471
altaywtf wants to merge 3 commits into
vectorize-io:mainfrom
uinaf:fix/coding-agents-worktree-opt-in

Conversation

@altaywtf

@altaywtf altaywtf commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Make optInOnly work for linked Git worktrees outside an approved checkout path. Resolution checks the literal worktree first, then its main checkout; explicit worktree mappings still win, and resolveWorktrees: false keeps inheritance disabled.

Risk

One bounded Git lookup is added during approval and bank resolution. Unapproved repositories remain inert.

Verification

  • 532 tests passed
  • package build passed
  • generated coding-agent docs match
  • changed TypeScript passes Prettier
  • rebase range-diff is patch-equivalent

Copilot AI lite review requested due to automatic review settings August 13, 2026 18:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mapPathToBank lookups, 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.

Comment thread hindsight-integrations/coding-agents/src/core/bank.ts
@altaywtf
altaywtf force-pushed the fix/coding-agents-worktree-opt-in branch from 401a144 to 6ba361a Compare August 15, 2026 12:48
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