From e5b2d1431262ab8b4b0075dc4065c762768e32b1 Mon Sep 17 00:00:00 2001 From: kulvirgit Date: Fri, 20 Mar 2026 17:31:54 -0700 Subject: [PATCH 1/3] 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) --- packages/opencode/src/config/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 9d9ef57d8b..12e3730e43 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -1294,8 +1294,8 @@ export namespace Config { // altimate_change start - auto MCP discovery toggle auto_mcp_discovery: z .boolean() - .optional() - .describe("Auto-discover MCP servers from VS Code, Claude Code, Copilot, and Gemini configs at startup (default: true). Set to false to disable."), + .default(true) + .describe("Auto-discover MCP servers from VS Code, Claude Code, Copilot, and Gemini configs at startup. Set to false to disable."), // altimate_change end }) .optional(), From 0f2f95f55aae180fa4296021f2376a3eaaf7d05b Mon Sep 17 00:00:00 2001 From: kulvirgit Date: Fri, 20 Mar 2026 17:32:24 -0700 Subject: [PATCH 2/3] 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) --- packages/opencode/test/tool/skill.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/opencode/test/tool/skill.test.ts b/packages/opencode/test/tool/skill.test.ts index 30fb9c2460..b80610c635 100644 --- a/packages/opencode/test/tool/skill.test.ts +++ b/packages/opencode/test/tool/skill.test.ts @@ -189,6 +189,7 @@ Use this skill. config: { experimental: { env_fingerprint_skill_selection: false, + auto_mcp_discovery: true, }, }, init: async (dir) => { @@ -225,6 +226,7 @@ Use this skill. config: { experimental: { env_fingerprint_skill_selection: true, + auto_mcp_discovery: true, }, }, init: async (dir) => { From d8b6375b349176e33431e9abbadc558947f68ab4 Mon Sep 17 00:00:00 2001 From: kulvirgit Date: Fri, 20 Mar 2026 17:34:10 -0700 Subject: [PATCH 3/3] 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) --- .opencode/opencode.jsonc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc index e16af2f78a..f9a81f1169 100644 --- a/.opencode/opencode.jsonc +++ b/.opencode/opencode.jsonc @@ -15,9 +15,4 @@ "github-triage": false, "github-pr-search": false, }, - // altimate_change start — disable auto MCP discovery for altimate-code - "experimental": { - "auto_mcp_discovery": false, - }, - // altimate_change end }