Skip to content

fix(engram): prevent double MCP registration in Antigravity and support Linuxbrew path - #1580

Closed
eezzekl wants to merge 4 commits into
Gentleman-Programming:mainfrom
eezzekl:fix/797-engram-antigravity
Closed

fix(engram): prevent double MCP registration in Antigravity and support Linuxbrew path#1580
eezzekl wants to merge 4 commits into
Gentleman-Programming:mainfrom
eezzekl:fix/797-engram-antigravity

Conversation

@eezzekl

@eezzekl eezzekl commented Jul 20, 2026

Copy link
Copy Markdown

🔗 Linked Issue

Closes #797


🏷️ PR Type

What kind of change does this PR introduce?

  • type:bug — Bug fix (non-breaking change that fixes an issue)
  • type:feature — New feature (non-breaking change that adds functionality)
  • type:docs — Documentation only
  • type:refactor — Code refactoring (no functional changes)
  • type:chore — Build, CI, or tooling changes
  • type:breaking-change — Breaking change (fix or feature that changes existing behavior)

📝 Summary

  • Stop writing a duplicate mcp_config.json in the Antigravity plugin directory; Engram MCP is now registered exactly once, in the global CLI config.
  • Recognize the Linuxbrew Engram binary path (/home/linuxbrew/.linuxbrew/bin/engram) as a stable path so auto-injection works on Linux installs via Linuxbrew.
  • Always pass --tools=agent when launching the Engram MCP server for Antigravity, instead of stripping it for that agent.

📂 Changes

File / Area What Changed
internal/components/engram/inject.go Removed the Antigravity-only branch that dropped --tools=agent; removed duplicate plugin-scope mcp_config.json write; added Linuxbrew path to isStableHomebrewEngramPath
internal/components/engram/inject_test.go Updated assertions to expect --tools=agent and to expect no plugin-scope mcp_config.json file

🧪 Test Plan

  • Unit tests pass (go test ./...)
  • Go format passes (go run ./internal/gofmtcheck)
  • E2E tests pass (cd e2e && ./docker-test.sh)
  • Manually tested locally

CI will run the full suite; local go toolchain wasn't available in this environment to run it beforehand.


✅ Contributor Checklist

  • PR is linked to an issue with status:approved
  • PR stays within 400 changed lines, or I have requested/obtained maintainer-applied size:exception with rationale documented
  • I have added the appropriate type:* label to this PR
  • Unit tests pass (go test ./...)
  • Go format passes (go run ./internal/gofmtcheck)
  • E2E tests pass (cd e2e && ./docker-test.sh)
  • I have updated documentation if necessary
  • My commits follow Conventional Commits format
  • My commits do not include Co-Authored-By trailers

💬 Notes for Reviewers

Local go was not runnable in this environment (permission denied on the go binary), so unit/format/E2E checks weren't executed locally before opening this PR — relying on CI to confirm. Branch was rebased onto latest origin/main before opening (no conflicts in internal/components/engram/inject.go despite other commits touching that file in between).

Summary by CodeRabbit

  • Bug Fixes
    • Improved Antigravity integration with Engram by aligning MCP configuration behavior with other supported agents.
    • Antigravity now includes the required agent tools configuration for Engram commands.
    • Prevented unnecessary plugin-level MCP configuration files from being created.
    • Added support for recognizing Engram installations managed through Linuxbrew.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Antigravity Engram registration now uses the standard MCP arguments, avoids writing a plugin-level mcp_config.json, and recognizes the Linuxbrew Engram binary path. Tests validate the updated CLI configuration and absence of the plugin MCP file.

Changes

Engram registration

Layer / File(s) Summary
Antigravity MCP registration
internal/components/engram/inject.go, internal/components/engram/inject_test.go
Antigravity uses the standard overlay arguments, no longer writes a plugin-level MCP configuration, and tests require --tools=agent in the CLI configuration while asserting the plugin MCP file is absent.
Linuxbrew path detection
internal/components/engram/inject.go
The stable Engram path allowlist includes /home/linuxbrew/.linuxbrew/bin/engram.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type:bug

Suggested reviewers: alan-thegentleman

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes match #797 by removing plugin-level mcp_config.json, preserving --tools=agent, and recognizing the Linuxbrew Engram path.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes are shown; the edits stay focused on Antigravity Engram injection and its tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: removing duplicate MCP registration in Antigravity and adding Linuxbrew path support.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@Alan-TheGentleman

Copy link
Copy Markdown
Contributor

Closing as duplicate of #1643. That carrier includes the Linuxbrew and tool-profile behavior from this PR plus the transactional ownership migration, idempotency, and recovery tests needed for #797. Please continue review and the remaining rollback fix there.

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.

fix(engram): prevent double MCP registration in Antigravity and support Linuxbrew path

2 participants