Skip to content

fix(claude-connect): the bridge stops at the first project boundary instead of walking past it - #270

Merged
omridevk merged 2 commits into
mainfrom
bridge-boundary-fix
Aug 6, 2026
Merged

omridevk merged 2 commits into
mainfrom
bridge-boundary-fix

Conversation

@omridevk

@omridevk omridevk commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Post-merge fix for PR #266's Copilot findings (the real one plus the style one).

  • The endpoint walk now stops at the FIRST ancestor containing a .conciv directory - a project boundary is the directory's existence, endpoint file or not. A nested project (worktree under a parent project) whose dev server is not running gets a loud error naming ITS directory instead of silently bridging to the parent's server. Pre-fix TDD proof: the new nested-no-endpoint IT received a success frame from the PARENT server (wrong-project bridging, verbatim in the issue thread); post-fix it errors naming the child dir and the parent records zero requests. Companion IT proves a nested project WITH its own endpoint uses it (parent still zero).
  • The push-accumulator ancestor loop is gone - the walk resolves the endpoint directly (functional-style rule).

Gates: claude-connect 26/26 (typecheck+build+test), lint/format clean, fallow 0 introduced. One unrelated flake in the wide fan-out (core turn-detach stream timing) reran green standalone; two parallel-build races likewise verified clean standalone.

🤖 Generated with Claude Code

…iv directory

The generated bridge kept climbing past an ancestor .conciv directory that had
no mcp-endpoint.json, so a nested project with no running dev server silently
bridged to a parent project's server - the wrong-project bridging #243 was
fixing. The walk now stops at the first ancestor .conciv directory it finds:
use its endpoint if valid, otherwise fail naming that directory. Also drops
the mutable accumulator loop for a direct walk-and-resolve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 6, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Stops Claude Connect from crossing the first .conciv project boundary.

Changes:

  • Resolves endpoints directly at the nearest boundary.
  • Adds nested-project integration coverage.
  • Adds a patch changeset.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/claude-connect/src/bridge.ts Stops endpoint lookup at the nearest .conciv boundary.
packages/claude-connect/test/bridge.it.test.ts Tests nested projects with and without endpoints.
.changeset/nested-project-bridge-boundary.md Documents the patch release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/claude-connect/src/bridge.ts Outdated
}

function noEndpointAt(dir) {
return {url: null, reason: \`no \${stateDirName}/\${endpointFileName} at or above \${dir}\`}
…not ancestor search

The bridge walk stops at the first ancestor containing .conciv, but the
error message claimed no endpoint exists "at or above" the start
directory even when a boundary was found and only its endpoint file
was missing or stale. Split noEndpointAt into two cases: a found
boundary with no endpoint says so and names the expected file path; no
boundary found at all says no .conciv project directory was found
walking up from the start directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 6, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@omridevk
omridevk merged commit d019477 into main Aug 6, 2026
24 checks passed
@omridevk
omridevk deleted the bridge-boundary-fix branch August 6, 2026 12:25
@github-actions github-actions Bot mentioned this pull request Aug 7, 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