Pre-flight Checklist
π Bug Description
When gentle-ai configures Engram for OpenCode, it writes the resolved symlink path into opencode.jsonc instead of using the bare binary name or the stable symlink path.
For example, it resolves:
engram β /home/linuxbrew/.linuxbrew/bin/engram β ../Cellar/engram/1.16.1/bin/engram
And writes:
"command": ["/home/linuxbrew/.linuxbrew/Cellar/engram/1.16.1/bin/engram", "mcp", "--tools=agent"]
When Homebrew upgrades Engram (e.g., 1.16.1 β 1.16.3), the old Cellar version directory is removed, and OpenCode gets ENOENT: no such file or directory, posix_spawn at startup.
The opencode.json (main config) correctly uses ["engram", "mcp", "--tools=agent"] β the bug is specifically in the opencode.jsonc override that gentle-ai generates with the resolved path.
π Steps to Reproduce
- Run brew upgrade gentleman-programming/tap/engram (via gentle-ai upgrade)
- Open OpenCode β Engram MCP fails silently
- Log shows: "server unavailable" key=engram type=local status=failed
- OpenCode shows: ENOENT: no such file or directory, posix_spawn /home/linuxbrew/.linuxbrew/Cellar/engram/1.16.1/bin/engram
β
Expected Behavior
gentle-ai should write the binary name or the stable symlink path (e.g., "engram" or "/home/linuxbrew/.linuxbrew/bin/engram") instead of the resolved Cellar version path. This way OpenCode resolves the symlink dynamically and survives Homebrew upgrades.
// Should write this:
"command": ["engram", "mcp", "--tools=agent"]
// or:
"command": ["/home/linuxbrew/.linuxbrew/bin/engram", "mcp", "--tools=agent"]
β Actual Behavior
gentle-ai resolves the symlink to the concrete Cellar version path and hardcodes it in opencode.jsonc. After any brew upgrade, the old version path becomes stale and OpenCode cannot spawn the Engram MCP server.
Gentle AI Version
v1.40.2
Operating System
Linux (Ubuntu/Debian)
AI Agent / Client
OpenCode
π Affected Area
Installation Pipeline
π‘ Logs / Error Output
OpenCode log entries:
"server unavailable" key=engram type=local status=failed
Config that breaks (in ~/.config/opencode/opencode.jsonc):
"command": ["/home/linuxbrew/.linuxbrew/Cellar/engram/1.16.1/bin/engram", "mcp", "--tools=agent"]
Additional Context
- Root cause: the code that writes the MCP command resolves the binary path through symlinks into the Cellar version directory instead of preserving the original command.
- Workaround: edit ~/.config/opencode/opencode.jsonc and replace the hardcoded path with "engram", then restart OpenCode.
- Affects all Homebrew-managed installations (Linuxbrew on Linux, likely macOS too with /opt/homebrew/Cellar/engram/...).
- The opencode.json main config is NOT affected β it correctly uses ["engram", "mcp", "--tools=agent"].
- Multiple OpenCode sessions on June 14 all failed with the same error after the Engram upgrade from 1.16.1 to 1.16.3.
Pre-flight Checklist
status:approvedπ Bug Description
When gentle-ai configures Engram for OpenCode, it writes the resolved symlink path into
opencode.jsoncinstead of using the bare binary name or the stable symlink path.For example, it resolves:
engram β /home/linuxbrew/.linuxbrew/bin/engram β ../Cellar/engram/1.16.1/bin/engram
And writes:
π Steps to Reproduce
β Expected Behavior
gentle-ai should write the binary name or the stable symlink path (e.g., "engram" or "/home/linuxbrew/.linuxbrew/bin/engram") instead of the resolved Cellar version path. This way OpenCode resolves the symlink dynamically and survives Homebrew upgrades.
β Actual Behavior
gentle-ai resolves the symlink to the concrete Cellar version path and hardcodes it in opencode.jsonc. After any brew upgrade, the old version path becomes stale and OpenCode cannot spawn the Engram MCP server.
Gentle AI Version
v1.40.2
Operating System
Linux (Ubuntu/Debian)
AI Agent / Client
OpenCode
π Affected Area
Installation Pipeline
π‘ Logs / Error Output
Additional Context