Skip to content

fix(opencode): empty repo .opencode/opencode.json — disabled flag ignored, removed mcp block entirely - #110

Merged
jphein merged 1 commit into
mainfrom
fix/opencode-repo-config-empty
May 22, 2026
Merged

fix(opencode): empty repo .opencode/opencode.json — disabled flag ignored, removed mcp block entirely#110
jphein merged 1 commit into
mainfrom
fix/opencode-repo-config-empty

Conversation

@jphein

@jphein jphein commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR #108 set the repo-level MCP entry's `enabled` to false to avoid spawning a second mempalace MCP server alongside the user-level daemon-routed wrapper. That didn't work — opencode merges repo + user configs by entry name, and the repo `command` keeps overriding the user one even with `enabled: false`.

Confirmed by reading opencode's session log post-#108-merge: `mempalace-mcp: routing → local palace @ /home/jp/.mempalace/palace` + the HNSW capacity divergence warning, meaning the repo's local-spawn was the one that actually ran.

Strip the `mcp` block from the repo config entirely. User-level wrapper now handles daemon routing without contention. Contributors who don't have a daemon set up can add their own user-level config or a `.opencode/opencode.local.json` (already gitignored).

Test plan

  • `opencode` launched from repo root logs only the user-level wrapper command, not `.venv/bin/python -m mempalace.mcp_server`
  • mempalace_status returns daemon stats (310K drawers, postgres-backed) not the local 24,920-drawer stale palace
  • No "HNSW capacity divergence" warnings on session start

Follow-up

The right long-term fix is upstream support for `enabled: false` actually meaning "don't merge this entry's command." Worth filing on opencode but out of scope here.

🤖 Generated with Claude Code

…riding user wrapper

The previous `enabled: false` approach (PR #108) didn't work in
practice. opencode appears to merge the repo-level and user-level
MCP entries by name; the repo entry's `command` overrides the
user-level one even when `enabled` is set to false.

Symptom: the user-level wrapper at
`~/.config/opencode/opencode.jsonc` points at the daemon-routed
`mempalace-mcp-wrapper.sh`. The repo-level entry pointed at
`.venv/bin/python -m mempalace.mcp_server`. Opencode's log on
session start shows the local palace getting opened with
'mempalace-mcp: routing → local palace @ /home/jp/.mempalace/palace'
and the HNSW capacity divergence warning — meaning the repo's
local-spawn command won despite enabled=false.

Strip the `mcp` block from the repo config entirely. The user-level
wrapper handles daemon routing. Contributors who don't have a daemon
can add their own user-level config or re-add the entry under
`.opencode/opencode.local.json` (gitignored).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 04:02
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the repository-level MCP configuration was overriding user-level settings despite the 'enabled: false' flag. By removing the mcp block entirely, the configuration now correctly defers to the user-level wrapper, preventing contention and resolving HNSW capacity divergence warnings during session startup.

Highlights

  • MCP Configuration Cleanup: Removed the entire mcp block from .opencode/opencode.json to resolve configuration merging conflicts.
  • Conflict Resolution: Eliminated the local MCP server spawning which was incorrectly overriding the user-level daemon-routed wrapper.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the .opencode/opencode.json configuration file by removing the mcp object and its associated mempalace server settings. I have no feedback to provide.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jphein
jphein merged commit 7133eee into main May 22, 2026
10 of 11 checks passed
@jphein
jphein deleted the fix/opencode-repo-config-empty branch May 22, 2026 04:06
jphein added a commit that referenced this pull request May 22, 2026
…merges (#112)

Five PRs landed today that didn't have YAML entries yet; CLAUDE.md +
README still referenced the pre-transfer jphein/mempalace ownership;
the opencode integration recipe didn't cover the two gotchas that
bit us tonight (npm-vs-opencode-cache patch target; the "looks like
an error" stderr lines from local-palace spawns).

YAML additions (newest first):
  - local-palace-retired-marker (#111798cf14)
  - opencode-repo-config-empty-mcp (#1107133eee)
  - opencode-repo-mcp-drop-comment-key (#109637bb01)
  - opencode-repo-mcp-disable-flag (#10847018e5; superseded by #110)
  - mcp-stub-resources-prompts-list (#1076ca0670)

CLAUDE.md changes:
  - Fork URL: `jphein/mempalace` → `techempower-org/mempalace`
  - Origin/upstream line reflects the May 2026 transfer
  - Palace data section: local palace is retired; production lives in
    postgres on disks.jphe.in
  - Python venv: `./venv/` → `./.venv/` (uv convention)
  - Issue tracker links updated to techempower-org

README.md changes:
  - Quickstart and `Open upstream PRs` table use techempower-org URLs

docs/integrations/opencode.md changes:
  - New "Patch target gotcha" subsection: opencode caches plugins under
    ~/.cache/opencode/packages/ independently of the global npm install;
    patches must apply there.
  - New "What 'looks like an error' but isn't" verification subsection
    listing the three stderr lines that surfaced today during debug.
  - New "If you see a different palace count" troubleshooting block:
    palace-count divergence between MCP and CLI usually means an old
    shell without PALACE_DAEMON_URL; on this fork the local palace is
    retired so the CLI now refuses with the marker text.

FORK_CHANGELOG.md regenerated via scripts/render-docs.py. check-docs.sh
clean (29 fork hash refs resolve; only existing MemPalace#1024 pr_state warning,
unchanged).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants