Skip to content

fix(context): register repos before the already-indexed skip guard (#1317) - #1691

Merged
Shashankss1205 merged 1 commit into
mainfrom
fix/1317-context-registration
Sep 2, 2026
Merged

Shashankss1205 merged 1 commit into
mainfrom
fix/1317-context-registration

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Exactly the ordering bug @apklein diagnosed: the already indexed. Skipping. early return sat above register_repo_in_context, so once a named context's graph was populated by any path that skipped registration (MCP add_code_to_graph, an interrupted run), every subsequent cgc index --context short-circuited before the registration line — permanently self-perpetuating Repos Linked: 0.

Registration (idempotent by design — verified) now runs before the guard, and it uses the resolved context name, fixing the sibling gap where indexing under a default named context (no explicit --context flag) never registered at all.

Two hermetic CLI tests: (1) simulate the desync (populated graph, emptied repos: list) and prove the skip path reconciles it; (2) prove the default-named-context path registers. Unit suite 1457 green; CLI integration slice green.

Fixes #1317

…dy-indexed skip guard (#1317)

The early 'already indexed. Skipping.' return sat above
register_repo_in_context, so a graph populated by any path that skipped
registration (the MCP add_code_to_graph tool, an interrupted run) could
never reconcile config.yaml through the normal command — 'cgc context list'
showed 'Repos Linked: 0' forever, self-perpetuating exactly as #1317
diagnosed. Registration (idempotent by design) now runs first, and it uses
the RESOLVED context name so indexing under a default named context
registers too, not only an explicit --context flag.

Hermetic CLI tests cover the desync-reconciliation path and the
default-context path.
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
code-graph-context-pack Ready Ready Preview Sep 2, 2026 9:08pm UTC

@github-project-automation github-project-automation Bot moved this to Backlog tasks in CGC Progress Board Sep 2, 2026
@Shashankss1205
Shashankss1205 merged commit 05d251c into main Sep 2, 2026
2 of 3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

@Shashankss1205
Shashankss1205 deleted the fix/1317-context-registration branch September 2, 2026 21:08
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Code Graph Analysis

fix(context): register repos before the already-indexed skip guard (#1317) (#1691)

📊 Interactive Visualization

View the blast radius graph: PR Reviewer Dashboard

📦 Artifacts

The graph JSON has been uploaded as a build artifact: pr-code-graph-1691


Generated by CodeGraphContext using FalkorDB Lite

This branch was successfully deployed

1 active deployment
Preview — 351e3216 Deployed Sep 2, 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

Status: Done

Development

Successfully merging this pull request may close these issues.

Named context "Repos Linked: 0" desync: index_helper early-return skips register_repo_in_context for already-populated graphs

1 participant