Skip to content

fix(nova): discover GitHub branches without local pairing - #360

Merged
yashdev9274 merged 1 commit into
mainfrom
capy/discover-github-branches-without
Nov 19, 2026
Merged

yashdev9274 merged 1 commit into
mainfrom
capy/discover-github-branches-without

Conversation

@yashdev9274

Copy link
Copy Markdown
Owner

Fix branch discovery for connected repositories without requiring users to pair a local companion.

GitHub branches and exact execution sources

  • Load paginated branches and the repository's real default branch through the authenticated GitHub connection, independently of local pairing.
  • Freeze the selected repository, branch, and resolved SHA in new cloud/web sessions. File packing, file references, the file panel, and both E2B and Vercel checkouts use that exact commit rather than silently returning to the default branch.
  • Inherit pinned sources in side threads, reject conflicting project/local-workspace bindings, preserve unrelated user attachments, and prevent writes into an unbound original folder.

Local Git discovery

  • Match the selected repository or an unambiguous local folder instead of selecting the first approved root.
  • Discover real Git worktrees through the paired companion, including external, detached, locked, and missing entries. Only validated Nova-managed entries can resume their bound thread; unmanaged worktrees remain discovery-only.
  • Keep pairing, exact Origin/Host checks, strict request validation, bounded listings, and sanitized errors intact.

Verification

  • 92 focused tests passed across discovery, authorization, immutable sources, checkout providers, file isolation, the Git engine, and transport.
  • Web TypeScript, scoped ESLint, and diff whitespace checks passed.
  • Browser verification used actual Nova components with mocked GitHub responses and a real local Git fixture: GitHub discovery and selection made zero loopback-companion requests; pinned file references used the bound source; actual local worktrees appeared without a browser thread cache; the mobile dropdown fit a 390px viewport.
  • Live authenticated GitHub/cloud-provider execution was not exercised.

No new database migration is required. Deploy the web changes and restart the updated companion to enable local worktree discovery. Local Git still requires an authorized running helper; GitHub branch discovery does not.

GitHub branches without local pairing

Mobile GitHub branch discovery

Open in Capy

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
supercli Ready Ready Preview Nov 19, 2026 7:32am UTC
supercli-client Ready Ready Preview Nov 19, 2026 7:32am UTC
supercli-docs Ready Ready Preview Nov 19, 2026 7:32am UTC
1 Skipped Deployment
Project Deployment Actions Updated
vercel-supercodeai-integration Skipped Skipped Nov 19, 2026 7:32am UTC

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

if (source) {
await connectedGithubRepository(userId, source.repositoryFullName)
const { data: tree } = await github.rest.git.getTree({ owner, repo: name, tree_sha: source.sha, recursive: "true" })
paths = (tree.tree ?? []).flatMap((item) => item.type === "blob" && item.path && isLikelyTextProjectPath(item.path) ? [item.path] : [])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pinned turns automatically send tracked secret files such as .env and secrets.json to the model because the refreshed tree bypasses the existing sensitive-path exclusions.

Fix on Vercel

Comment on lines +67 to +70
const sourcePaths = new Set((tree.tree ?? []).flatMap((item) => item.type === "blob" && item.path ? [item.path] : []))
existing = existing.filter((file) => !sourcePaths.has(file.name))
}
if (paths.length === 0) return existing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Explicitly attached project files are silently removed from pinned turns when their paths are excluded by the automatic file filter or ranking.

Fix on Vercel

@yashdev9274
yashdev9274 merged commit 878b79a into main Nov 19, 2026
6 of 10 checks passed

This branch was successfully deployed

3 active and 1 inactive deployments
Preview – supercli — 99d861f9 Deployed Nov 19, 2026 by vercel[bot]
Preview – supercli-docs — 99d861f9 Deployed Nov 19, 2026 by vercel[bot]
Preview – supercli-client — 99d861f9 Deployed Nov 19, 2026 by vercel[bot]
Preview – vercel-supercodeai-integration — 99d861f9 Deployed Nov 19, 2026 by vercel[bot]
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.

1 participant