Repository navigation
Conversation
…ettings alone (colbymchenry#3234) `codegraph upgrade` runs `codegraph install --refresh` in the terminal's current directory, which in a new terminal is the home folder. The refresh sweeps both locations, and the local one reads a target's files under `process.cwd()`. In the home folder those are the user-wide files (`./.cursor/mcp.json` is `~/.cursor/mcp.json`, `./.codex/config.toml` is `~/.codex/config.toml`), so every global install looked like a local one and was rewritten as a project's: - Cursor's global entry had `--path ${workspaceFolder}` replaced by the home folder's absolute path, so every workspace served the home folder. - Codex, Gemini CLI and Qwen Code got `~/AGENTS.md`, `~/GEMINI.md` and `~/QWEN.md`, which are not their user-wide instructions files. The local sweep now skips a directory `init` refuses as a project root (home, a parent of it, a filesystem root), through the existing unsafeIndexRootReason. A local sweep inside a project is unchanged.
colbymchenry
added a commit
that referenced
this pull request
Nov 18, 2026
… user-wide setup
`codegraph upgrade` runs `codegraph install --refresh`, which sweeps the
global and the local location from whatever folder the terminal is in, and
a new terminal opens in the home folder. There an agent's project file and
its user-wide file are the same file: `./.cursor/mcp.json` is
`~/.cursor/mcp.json`, `./.codex/config.toml` is `~/.codex/config.toml`, and
likewise for Gemini CLI and Qwen Code. The local half of the sweep detected
each global install as a local one and re-installed it as a project's:
- Cursor's global entry had `--path ${workspaceFolder}` replaced with the
home folder's absolute path, so every Cursor workspace was served the
home folder (until a later refresh from some other folder put it back);
- Codex, Gemini CLI and Qwen Code got `~/AGENTS.md`, `~/GEMINI.md` and
`~/QWEN.md`, which none of them reads as its user-wide instructions.
refreshTargets now finds nothing configured for a local sweep from a folder
that holds no project, the folders `init` already refuses (the home
folder, a folder above it, a filesystem root), using the same
unsafeIndexRootReason check. The global half is unchanged, and a local
sweep inside a project refreshes as before. Nothing is printed for the
skipped half, so an upgrade from the home folder stays as quiet as one
that has nothing local to refresh.
Validation:
- installer-targets.test.ts: a new test installs every agent globally into
a temp home, runs the local sweep from it, and checks every file there
is byte-identical, no AGENTS.md / GEMINI.md / QWEN.md appears, and
Cursor keeps `${workspaceFolder}`. Red on main (Cursor reported
refreshed), green here. A second test checks a local sweep inside a
project still refreshes a stale block. The whole file passes
(616 passed, 10 skipped), as do installer, installer-links-simulated,
upgrade and cli-install-init (101 passed).
- Real CLI against a temp HOME (every agent installed globally, then
`install --refresh` from HOME): v1.6.3 sources changed `.cursor/mcp.json`
and created AGENTS.md, GEMINI.md and QWEN.md; this branch left all 31
files byte-identical. From a project with a local Codex install, both
refresh its AGENTS.md.
Left out: an explicit `codegraph install --location local` run from the home
folder still writes there; that's a direct request, not a sweep, and
refusing it is a separate call.
PR #3281 (@b84330808) and PR #3288 (@LuisAlbertoMK) proposed the same guard;
this follows #3281's quiet shape.
Fixes #3234
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
colbymchenry
added a commit
that referenced
this pull request
Nov 18, 2026
… user-wide setup (#3333) `codegraph upgrade` runs `codegraph install --refresh`, which sweeps the global and the local location from whatever folder the terminal is in, and a new terminal opens in the home folder. There an agent's project file and its user-wide file are the same file: `./.cursor/mcp.json` is `~/.cursor/mcp.json`, `./.codex/config.toml` is `~/.codex/config.toml`, and likewise for Gemini CLI and Qwen Code. The local half of the sweep detected each global install as a local one and re-installed it as a project's: - Cursor's global entry had `--path ${workspaceFolder}` replaced with the home folder's absolute path, so every Cursor workspace was served the home folder (until a later refresh from some other folder put it back); - Codex, Gemini CLI and Qwen Code got `~/AGENTS.md`, `~/GEMINI.md` and `~/QWEN.md`, which none of them reads as its user-wide instructions. refreshTargets now finds nothing configured for a local sweep from a folder that holds no project, the folders `init` already refuses (the home folder, a folder above it, a filesystem root), using the same unsafeIndexRootReason check. The global half is unchanged, and a local sweep inside a project refreshes as before. Nothing is printed for the skipped half, so an upgrade from the home folder stays as quiet as one that has nothing local to refresh. Validation: - installer-targets.test.ts: a new test installs every agent globally into a temp home, runs the local sweep from it, and checks every file there is byte-identical, no AGENTS.md / GEMINI.md / QWEN.md appears, and Cursor keeps `${workspaceFolder}`. Red on main (Cursor reported refreshed), green here. A second test checks a local sweep inside a project still refreshes a stale block. The whole file passes (616 passed, 10 skipped), as do installer, installer-links-simulated, upgrade and cli-install-init (101 passed). - Real CLI against a temp HOME (every agent installed globally, then `install --refresh` from HOME): v1.6.3 sources changed `.cursor/mcp.json` and created AGENTS.md, GEMINI.md and QWEN.md; this branch left all 31 files byte-identical. From a project with a local Codex install, both refresh its AGENTS.md. Left out: an explicit `codegraph install --location local` run from the home folder still writes there; that's a direct request, not a sweep, and refusing it is a separate call. PR #3281 (@b84330808) and PR #3288 (@LuisAlbertoMK) proposed the same guard; this follows #3281's quiet shape. Fixes #3234 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #3234
codegraph upgraderunscodegraph install --refreshin the current directory, and a new terminal starts in the home folder. The refresh sweeps both locations, and the local sweep reads each target's files underprocess.cwd(). In the home folder those are the user-wide files (./.cursor/mcp.jsonis~/.cursor/mcp.json), so every global install looked like a local one and was rewritten as a project's:--path ${workspaceFolder}replaced with the home folder's absolute path, so every workspace served the home folder.~/AGENTS.md,~/GEMINI.mdand~/QWEN.md, which aren't their user-wide instructions files.refreshTargetsnow skips every target in a local sweep when the current directory is oneinitrefuses as a project root (home, a parent of it, a filesystem root), using the existingunsafeIndexRootReason. A local sweep inside a project is unchanged, and the global sweep still refreshes the user-wide installs.Testing: added two tests to
__tests__/installer-targets.test.ts. The first installs every target globally in a temporary home folder, runs a local sweep from there, and checks that no file in it changed and Cursor's entry still uses${workspaceFolder}. Without the fix it fails withexpected [ 'not-configured', 'unsupported' ] to include 'refreshed'. The second checks that a local sweep inside a project still refreshes a local install.npx vitest run __tests__/installer-targets.test.tspasses. I ran it on Windows 11 only; the change has no platform-specific code.