fix(opencode): drop $comment field — schema rejects unknown root keys - #109
Conversation
…ot fields The $comment field I added in commit 47018e5 to explain why the repo-level MCP entry defaults to enabled=false isn't part of opencode's config schema. Opencode's bootstrap validator throws ConfigInvalidError and refuses to start the TUI entirely: Error: 4 of 5 requests failed: Unexpected server error. Affected startup requests: config.providers, provider.list, app.agents, config.get JSON parses fine, but opencode rejects unknown top-level keys. Move the explanation to a code comment if needed; for now just remove the field so opencode starts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, 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 a configuration issue where the inclusion of a $comment field in the repository's opencode configuration caused the application to fail during startup. Because the opencode schema validator strictly rejects unknown top-level keys, removing this field ensures the configuration is valid and allows the TUI to initialize correctly. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request removes the $comment field from .opencode/opencode.json to resolve a startup failure caused by schema validation. The reviewer suggests renaming the file to .opencode/opencode.jsonc to preserve the documentation using standard JSONC comments while maintaining compatibility with the schema validator.
| @@ -1,6 +1,5 @@ | |||
| { | |||
| "$schema": "https://opencode.ai/config.json", | |||
| "$comment": "Repo-level MCP entry disabled by default to avoid spawning a second mempalace-mcp against the legacy local palace when a user-level (daemon-routed) entry is also configured. Contributors without a daemon can flip enabled=true; their python with mempalace installed will be picked up from .venv/bin/python.", | |||
There was a problem hiding this comment.
Removing this field fixes the startup failure but loses important documentation for contributors. Since the PR description mentions that opencode.jsonc is supported for user-level configuration, consider renaming this file to .opencode/opencode.jsonc and using standard JSONC comments (//) instead of the $comment key. This would preserve the explanation while satisfying the strict schema validator.
…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 (#111 — 798cf14) - opencode-repo-config-empty-mcp (#110 — 7133eee) - opencode-repo-mcp-drop-comment-key (#109 — 637bb01) - opencode-repo-mcp-disable-flag (#108 — 47018e5; superseded by #110) - mcp-stub-resources-prompts-list (#107 — 6ca0670) 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>
Summary
In commit `47018e5` (PR #108) I added a `$comment` field to `.opencode/opencode.json` explaining why the repo-level MCP entry defaults to `enabled: false`. opencode rejects unknown top-level keys via its schema validator and refuses to start the TUI:
```
Error: 4 of 5 requests failed: Unexpected server error.
Affected startup requests: config.providers, provider.list, app.agents, config.get
```
JSON parses (`$comment` is a popular convention, JSON-Schema recognizes it), but opencode's strict schema doesn't allow it. Removing the field unblocks opencode startup. Explanation lives in the commit message + PR descriptions if needed later.
Test plan
🤖 Generated with Claude Code