[PR #866] [MERGED] fix(setup): read an OpenCode V2 server named type as a table entry #2302

Closed
opened 2026-10-16 21:17:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/866
Author: @kaoru0822-kitauji
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @morluto

Base: main ← Head: fix/opencode-v2-type-server


📝 Commits (1)

  • fcc8c78 fix(setup): read an OpenCode V2 server named type as a table entry

📊 Changes

2 files changed (+33 additions, -2 deletions)

View changed files

📝 src/application/ClientConfigurationDocument.ts (+6 -2)
📝 tests/boundary/filesystem/clientConfigurationDialects.test.ts (+27 -0)

📄 Description

Summary

This follows up #864 and addresses its Codex P2, "Distinguish the type server from a V1 discriminator", which was posted after merge.

#864 treated mcp.servers as a V1 server named servers whenever the object had a type property. A valid V2 table can hold a server named type:

{ "mcp": { "servers": { "type": { "type": "local", "command": ["node", "type.js"] },
                        "rea":  { "type": "local", "command": ["npx", "-y", "rea-agents@…", "mcp"] } } } }

On main, this document is read as V1. Status reports REA as missing, setup writes an mcp.rea that the native mcp.servers.rea overrides, and uninstall leaves the native entry in place.

Fix

Only a string type (the V1 "local"/"remote" discriminator) marks mcp.servers as a V1 entry. A server object named type leaves it as the native table.

Verification

  • New regression in tests/boundary/filesystem/clientConfigurationDialects.test.ts: with a V2 table containing type and rea, status is aligned and uninstall removes only rea. It fails on main and passes here. The existing V1-server-named-servers case still passes (20/20).
  • npm run check:changed and npm run check:fast passed.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/866 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/opencode-v2-type-server` --- ### 📝 Commits (1) - [`fcc8c78`](https://github.com/morluto/rea/commit/fcc8c7837b5e0f6a3abb849c4964b0f01c165f53) fix(setup): read an OpenCode V2 server named type as a table entry ### 📊 Changes **2 files changed** (+33 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClientConfigurationDocument.ts` (+6 -2) 📝 `tests/boundary/filesystem/clientConfigurationDialects.test.ts` (+27 -0) </details> ### 📄 Description ## Summary This follows up #864 and addresses its Codex P2, ["Distinguish the `type` server from a V1 discriminator"](https://github.com/morluto/rea/pull/864), which was posted after merge. #864 treated `mcp.servers` as a V1 *server named `servers`* whenever the object had a `type` property. A valid V2 table can hold a server **named** `type`: ```json { "mcp": { "servers": { "type": { "type": "local", "command": ["node", "type.js"] }, "rea": { "type": "local", "command": ["npx", "-y", "rea-agents@…", "mcp"] } } } } ``` On `main`, this document is read as V1. Status reports REA as missing, setup writes an `mcp.rea` that the native `mcp.servers.rea` overrides, and uninstall leaves the native entry in place. ## Fix Only a **string** `type` (the V1 `"local"`/`"remote"` discriminator) marks `mcp.servers` as a V1 entry. A server object named `type` leaves it as the native table. ## Verification - New regression in `tests/boundary/filesystem/clientConfigurationDialects.test.ts`: with a V2 table containing `type` and `rea`, status is `aligned` and uninstall removes only `rea`. **It fails on `main` and passes here.** The existing V1-server-named-`servers` case still passes (20/20). - `npm run check:changed` and `npm run check:fast` passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2302
No description provided.