Skip to content

Commit 2ba7c67

Browse files
kulvirgitclaude
andauthored
feat: default auto_mcp_discovery to true (#345)
* feat: default auto_mcp_discovery to true in config schema The runtime behavior already defaulted to enabled (discovery runs unless explicitly set to false), but the Zod schema used `.optional()` which left the field as `undefined`. Switch to `.default(true)` so the schema matches the actual runtime default and serialized configs show the correct value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add auto_mcp_discovery to test experimental configs The .default(true) change made the field required in Zod's output type, so test configs that construct experimental objects need the field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove explicit auto_mcp_discovery: false from project config No longer needed since the schema now defaults to true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 36a244c commit 2ba7c67

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

.opencode/opencode.jsonc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@
1515
"github-triage": false,
1616
"github-pr-search": false,
1717
},
18-
// altimate_change start — disable auto MCP discovery for altimate-code
19-
"experimental": {
20-
"auto_mcp_discovery": false,
21-
},
22-
// altimate_change end
2318
}

packages/opencode/src/config/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,8 @@ export namespace Config {
12941294
// altimate_change start - auto MCP discovery toggle
12951295
auto_mcp_discovery: z
12961296
.boolean()
1297-
.optional()
1298-
.describe("Auto-discover MCP servers from VS Code, Claude Code, Copilot, and Gemini configs at startup (default: true). Set to false to disable."),
1297+
.default(true)
1298+
.describe("Auto-discover MCP servers from VS Code, Claude Code, Copilot, and Gemini configs at startup. Set to false to disable."),
12991299
// altimate_change end
13001300
})
13011301
.optional(),

packages/opencode/test/tool/skill.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Use this skill.
189189
config: {
190190
experimental: {
191191
env_fingerprint_skill_selection: false,
192+
auto_mcp_discovery: true,
192193
},
193194
},
194195
init: async (dir) => {
@@ -225,6 +226,7 @@ Use this skill.
225226
config: {
226227
experimental: {
227228
env_fingerprint_skill_selection: true,
229+
auto_mcp_discovery: true,
228230
},
229231
},
230232
init: async (dir) => {

0 commit comments

Comments
 (0)