Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions internal/components/engram/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ func engramOverlayJSON(agentID model.AgentID, cmd string) []byte {
}
} else {
args := []string{"mcp", "--tools=agent"}
if agentID == model.AgentAntigravity {
// Antigravity should launch the default Engram MCP server without
// narrowing the exposed tool set.
args = []string{"mcp"}
}
cfg = map[string]any{
"mcpServers": map[string]any{
"engram": map[string]any{
Expand Down Expand Up @@ -275,14 +270,6 @@ func installAntigravityEngramPlugin(homeDir, engramCommand string) (bool, []stri
changed = changed || pluginWrite.Changed
files = append(files, pluginPath)

pluginMCPPath := filepath.Join(pluginDir, "mcp_config.json")
mcpWrite, err := filemerge.WriteFileAtomic(pluginMCPPath, engramOverlayJSON(model.AgentAntigravity, engramCommand), 0o644)
if err != nil {
return false, nil, fmt.Errorf("write Antigravity Engram plugin MCP config: %w", err)
}
changed = changed || mcpWrite.Changed
files = append(files, pluginMCPPath)

hooksPath := filepath.Join(pluginDir, "hooks.json")
hooksWrite, err := filemerge.WriteFileAtomic(hooksPath, antigravityEngramHooksJSON(), 0o644)
if err != nil {
Expand Down Expand Up @@ -854,7 +841,7 @@ func isVersionedHomebrewCellarPath(path string) bool {

func isStableHomebrewEngramPath(path string) bool {
clean := filepath.ToSlash(filepath.Clean(path))
return (clean == "/opt/homebrew/bin/engram" || clean == "/usr/local/bin/engram") && isEngramCommand(clean)
return (clean == "/opt/homebrew/bin/engram" || clean == "/usr/local/bin/engram" || clean == "/home/linuxbrew/.linuxbrew/bin/engram") && isEngramCommand(clean)
}

// resolveProfileAssignments builds the []codex.ProfileAssignment slice used
Expand Down
13 changes: 4 additions & 9 deletions internal/components/engram/inject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ func TestInjectAntigravityWritesMCPToCLIConfig(t *testing.T) {
if !strings.Contains(text, `"args": [`) || !strings.Contains(text, `"mcp"`) {
t.Fatalf("Antigravity MCP config must launch Engram MCP; got:\n%s", text)
}
if strings.Contains(text, `--tools=`) {
t.Fatalf("Antigravity should use Engram's default MCP invocation without tool-profile flags; got:\n%s", text)
if !strings.Contains(text, `"--tools=agent"`) {
t.Fatalf("Antigravity should use Engram's agent MCP invocation with tool-profile flags; got:\n%s", text)
}

pluginPath := filepath.Join(home, ".gemini", "antigravity-cli", "plugins", "gentle-ai-engram", "plugin.json")
Expand All @@ -592,13 +592,8 @@ func TestInjectAntigravityWritesMCPToCLIConfig(t *testing.T) {
}

pluginMCPPath := filepath.Join(home, ".gemini", "antigravity-cli", "plugins", "gentle-ai-engram", "mcp_config.json")
pluginMCPContent, err := os.ReadFile(pluginMCPPath)
if err != nil {
t.Fatalf("ReadFile(%q) error = %v", pluginMCPPath, err)
}
pluginMCPText := string(pluginMCPContent)
if !strings.Contains(pluginMCPText, `"mcp"`) || strings.Contains(pluginMCPText, `--tools=`) {
t.Fatalf("Antigravity Engram plugin MCP config should expose default Engram MCP tools; got:\n%s", pluginMCPText)
if _, err := os.Stat(pluginMCPPath); !os.IsNotExist(err) {
t.Fatalf("Antigravity Engram plugin MCP config should NOT be written: %v", err)
}

hooksPath := filepath.Join(home, ".gemini", "antigravity-cli", "plugins", "gentle-ai-engram", "hooks.json")
Expand Down
3 changes: 2 additions & 1 deletion testdata/golden/engram-antigravity-mcp.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"mcpServers": {
"engram": {
"args": [
"mcp"
"mcp",
"--tools=agent"
],
"command": "/opt/homebrew/bin/engram"
}
Expand Down