Skip to content

fix(mcp): gate --prune behind per-entry opt-in (prune: true) - #199

Open
gmoigneu wants to merge 1 commit into
mainfrom
fix/142-prune-opt-in
Open

fix(mcp): gate --prune behind per-entry opt-in (prune: true)#199
gmoigneu wants to merge 1 commit into
mainfrom
fix/142-prune-opt-in

Conversation

@gmoigneu

@gmoigneu gmoigneu commented May 3, 2026

Copy link
Copy Markdown
Contributor

Closes #142. Adds prune: bool to ConfigMcp (default false). Manager.Prune now requires at least one entry per target to set prune: true before removing orphans on that target. Defends against accidentally wiping MCP entries users added by hand to shared agent config files.

Manager.Prune used to remove every orphan entry on every managed
target, including agent config files (claude-code's ~/.claude.json,
codex's ~/.codex/config.toml) that hold MCP entries the user added
by hand outside of gaal. A single `gaal sync --prune` could wipe
those.

Adds `prune: bool` to ConfigMcp (default false). A target is now
eligible for orphan removal only when at least one ConfigMcp entry
pointing at it sets `prune: true`. Without it, the target is logged
at debug and skipped — the rest of --prune behaviour is unchanged.

The CLI --prune flag itself stays as the high-level gate; this PR
adds the per-target safety net inside it.

Closes #142.
@Theosakamg

Copy link
Copy Markdown
Contributor

No, use Claude system to detect if need to keep or remove

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.

mcp: gate --prune behind per-target opt-in to avoid wiping manual entries

2 participants