fix(antigravity): use global config directory for mcp_config.json#918
fix(antigravity): use global config directory for mcp_config.json#918moferrin wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthrough
ChangesAntigravity MCP Config Global Path
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Antigravity MCP config handling to use a single shared global config file location, and aligns tests/golden assertions with the new path.
Changes:
- Switch Antigravity
MCPConfigPathfrom variant-specific directories to~/.gemini/config/mcp_config.json. - Update golden test and injection tests to read/verify MCP config in the new global location.
- Adjust adapter path tests to expect the shared MCP config path for both CLI-only and Desktop-only setups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/components/golden_test.go | Updates golden test to read MCP config from the new shared global config directory. |
| internal/components/engram/inject_test.go | Renames test and updates expected MCP config output path to the shared global location. |
| internal/agents/antigravity/adapter_test.go | Updates adapter path tests to expect the global MCP config path. |
| internal/agents/antigravity/adapter.go | Changes MCPConfigPath implementation to always point at the shared global config file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cliMCPPath := filepath.Join(home, ".gemini", "config", "mcp_config.json") | ||
| content, err := os.ReadFile(cliMCPPath) | ||
| if err != nil { | ||
| t.Fatalf("ReadFile(%q) error = %v", cliMCPPath, err) |
| // MCP config written to ~/.gemini/config/mcp_config.json. | ||
| mcpJSON := readTestFile(t, filepath.Join(home, ".gemini", "config", "mcp_config.json")) |
| // Antigravity uses a shared global config for MCP across CLI, Desktop, and IDE. | ||
| return filepath.Join(homeDir, ".gemini", "config", "mcp_config.json") |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/components/engram/inject_test.go`:
- Line 571: The variable name cliMCPPath is misleading since the MCP config is
now stored in a global/shared location rather than a CLI-specific directory.
Rename the cliMCPPath variable to globalMCPPath (or mcpConfigPath) to accurately
reflect its purpose, and update all references to this variable throughout the
test file to maintain consistency.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b39ab65d-ac1d-4de8-ae2c-2ed325d12f61
📒 Files selected for processing (4)
internal/agents/antigravity/adapter.gointernal/agents/antigravity/adapter_test.gointernal/components/engram/inject_test.gointernal/components/golden_test.go
|
@coderabbitai review |
✅ Action performedReview finished.
|
🔗 Linked Issue
Closes #917
🏷️ PR Type
type:bug— Bug fix (non-breaking change that fixes an issue)type:feature— New feature (non-breaking change that adds functionality)type:docs— Documentation onlytype:refactor— Code refactoring (no functional changes)type:chore— Build, CI, or tooling changestype:breaking-change— Breaking change📝 Summary
Updates the Antigravity
MCPConfigPathto point to the global config directory (~/.gemini/config/mcp_config.json) instead of the variant-specific path (~/.gemini/antigravity-cli/mcp_config.json).Problem Context:
Antigravity enforces a configuration hierarchy where the global configuration file (
~/.gemini/config/mcp_config.json) takes absolute priority. This global config file is automatically created by Antigravity when it is installed.Because this global file exists (even if it is empty), Antigravity reads it, assumes its state, and completely ignores the CLI-specific file (
~/.gemini/antigravity-cli/mcp_config.json) that Gentle AI just finished configuring.As a result, Engram MCP tools are never injected into the session (tools like
mem_save,mem_context, etc., do not appear as callable actions in the agent's toolset), forcing users to investigate why the MCP is unavailable even though the Engram CLI works perfectly.By making this change and writing the configuration directly to the shared global directory, we ensure that:
📂 Changes
internal/agents/antigravity/adapter.goMCPConfigPathinternal/agents/antigravity/adapter_test.gointernal/components/engram/inject_test.gointernal/components/golden_test.go🧪 Test Plan
Unit Tests
go test ./...E2E Tests (Docker required)
go test ./...)cd e2e && ./docker-test.sh)✅ Contributor Checklist
status:approvedsize:exceptionwith rationale documentedtype:*label to this PRgo test ./...)cd e2e && ./docker-test.sh)Co-Authored-Bytrailers