From 2901b99567180a4d629ee04d855b211fb6b675cd Mon Sep 17 00:00:00 2001 From: s mz <69295615+smz202000@users.noreply.github.com> Date: Fri, 17 Jul 2026 16:06:58 +0800 Subject: [PATCH 1/2] docs: fix EnableConfigDiscovery summary to accurately describe agent discovery behavior The previous documentation incorrectly stated that custom instruction files are always loaded from the working directory regardless of the EnableConfigDiscovery setting. In practice, agent files (e.g. .github/agents/) are only discovered when EnableConfigDiscovery is true. Update the summary to clarify that: - Agent discovery is gated by EnableConfigDiscovery - Use SkipCustomInstructions to independently control instruction file loading Fixes #1887 --- dotnet/src/Types.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index 2bb643c75..f41d5d679 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -2983,8 +2983,9 @@ protected SessionConfigBase(SessionConfigBase? other) /// and , with explicit /// values taking precedence on name collision. /// - /// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) - /// are always loaded from the working directory regardless of this setting. + /// Agent discovery (e.g. .github/agents/) is only performed when this is + /// . Use to control + /// loading of custom instruction files independently. /// /// public bool? EnableConfigDiscovery { get; set; } From 773de57d115ddc14a9483652adeba1c2419cfd4f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 30 Jul 2026 15:26:35 +0000 Subject: [PATCH 2/2] docs: standardize EnableConfigDiscovery description across all SDKs Replace the per-language doc comments for EnableConfigDiscovery (and its ResumeSessionConfig equivalent) with a single consistent description: 'Enables runtime discovery of supported configuration. Explicitly supplied configuration takes precedence over discovered values.' The previous wording varied by language and, in .NET/Go/Node.js/Python, incorrectly claimed that custom instruction files are always loaded regardless of this setting (#1887) while omitting that agent discovery is gated by it. Rather than special-casing that one clarification in a single language, this applies one accurate, artifact-agnostic description everywhere EnableConfigDiscovery is documented: dotnet/src/Types.cs, go/types.go (SessionConfig + ResumeSessionConfig), nodejs/src/types.ts, python/copilot/client.py (create + resume), rust/src/types.rs (fields + builder methods on both configs), and java SessionConfig.java/ResumeSessionConfig.java setters. Files under src/generated/ (Node.js, Java, .NET, Rust, Go rpc/zrpc.go) are auto-generated from api.schema.json upstream and are intentionally left untouched. Fixes #1887 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- dotnet/src/Types.cs | 12 ++--------- go/types.go | 16 ++++----------- .../copilot/rpc/ResumeSessionConfig.java | 8 ++------ .../com/github/copilot/rpc/SessionConfig.java | 10 ++-------- nodejs/src/types.ts | 9 ++------- python/copilot/client.py | 20 ++++++------------- rust/src/types.rs | 12 +++++++---- 7 files changed, 26 insertions(+), 61 deletions(-) diff --git a/dotnet/src/Types.cs b/dotnet/src/Types.cs index f41d5d679..0611991ce 100644 --- a/dotnet/src/Types.cs +++ b/dotnet/src/Types.cs @@ -2977,16 +2977,8 @@ protected SessionConfigBase(SessionConfigBase? other) public string? ConfigDirectory { get; set; } /// - /// When , automatically discovers MCP server configurations - /// (e.g. .mcp.json, .vscode/mcp.json) and skill directories from - /// the working directory and merges them with any explicitly provided - /// and , with explicit - /// values taking precedence on name collision. - /// - /// Agent discovery (e.g. .github/agents/) is only performed when this is - /// . Use to control - /// loading of custom instruction files independently. - /// + /// Enables runtime discovery of supported configuration. Explicitly supplied + /// configuration takes precedence over discovered values. /// public bool? EnableConfigDiscovery { get; set; } diff --git a/go/types.go b/go/types.go index 6760f25e0..ac69d1fcf 100644 --- a/go/types.go +++ b/go/types.go @@ -1052,13 +1052,9 @@ type SessionConfig struct { // ConfigDirectory overrides the default configuration directory location. // When specified, the session will use this directory for storing config and state. ConfigDirectory string - // EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations - // (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory - // and merges them with any explicitly provided MCPServers and SkillDirectories, with - // explicit values taking precedence on name collision. + // EnableConfigDiscovery enables runtime discovery of supported configuration. + // Explicitly supplied configuration takes precedence over discovered values. // Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery. - // Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are - // always loaded from the working directory regardless of this setting. EnableConfigDiscovery *bool // SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval // for this session. Use in multitenant deployments to prevent cross-session @@ -1611,13 +1607,9 @@ type ResumeSessionConfig struct { WorkingDirectory string // ConfigDirectory overrides the default configuration directory location. ConfigDirectory string - // EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations - // (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory - // and merges them with any explicitly provided MCPServers and SkillDirectories, with - // explicit values taking precedence on name collision. + // EnableConfigDiscovery enables runtime discovery of supported configuration. + // Explicitly supplied configuration takes precedence over discovered values. // Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery. - // Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are - // always loaded from the working directory regardless of this setting. EnableConfigDiscovery *bool // SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval // for this session. Use in multitenant deployments to prevent cross-session diff --git a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java index 6f3c31565..6dcd6442c 100644 --- a/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java @@ -848,12 +848,8 @@ public Optional getEnableConfigDiscovery() { } /** - * Sets whether to automatically discover MCP server configurations and skill - * directories from the working directory. - *

- * When {@code true}, the CLI scans the working directory for {@code .mcp.json}, - * {@code .vscode/mcp.json} and skill directories, and merges them with - * explicitly provided configurations. + * Enables runtime discovery of supported configuration. Explicitly supplied + * configuration takes precedence over discovered values. * * @param enableConfigDiscovery * {@code true} to enable discovery, {@code false} to disable diff --git a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java index e611f66c8..4d0a8987e 100644 --- a/java/src/main/java/com/github/copilot/rpc/SessionConfig.java +++ b/java/src/main/java/com/github/copilot/rpc/SessionConfig.java @@ -1235,14 +1235,8 @@ public Optional getEnableConfigDiscovery() { } /** - * Sets whether to automatically discover MCP server configurations and skill - * directories from the working directory. - *

- * When {@code true}, the CLI scans the working directory for {@code .mcp.json}, - * {@code .vscode/mcp.json} and skill directories, and merges them with - * explicitly provided {@link #setMcpServers(Map)} and - * {@link #setSkillDirectories(List)}, with explicit values taking precedence on - * name collision. + * Enables runtime discovery of supported configuration. Explicitly supplied + * configuration takes precedence over discovered values. * * @param enableConfigDiscovery * {@code true} to enable discovery, {@code false} to disable diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index fc0fa51d0..8fb4152ec 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -1915,13 +1915,8 @@ export interface SessionConfigBase { configDirectory?: string; /** - * When true, automatically discovers MCP server configurations (e.g. `.mcp.json`, - * `.vscode/mcp.json`) and skill directories from the working directory and merges - * them with any explicitly provided `mcpServers` and `skillDirectories`, with - * explicit values taking precedence on name collision. - * - * Note: custom instruction files (`.github/copilot-instructions.md`, `AGENTS.md`, etc.) - * are always loaded from the working directory regardless of this setting. + * Enables runtime discovery of supported configuration. Explicitly supplied + * configuration takes precedence over discovered values. * * @default false */ diff --git a/python/copilot/client.py b/python/copilot/client.py index e6ac9b03e..091cee151 100644 --- a/python/copilot/client.py +++ b/python/copilot/client.py @@ -2088,13 +2088,9 @@ async def create_session( including tool visibility controls. agent: Agent to use for the session. config_directory: Override for the configuration directory. - enable_config_discovery: When True, automatically discovers MCP server - configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill - directories from the working directory and merges them with any - explicitly provided ``mcp_servers`` and ``skill_directories``, with - explicit values taking precedence on name collision. Custom instruction - files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are - always loaded regardless of this setting. + enable_config_discovery: Enables runtime discovery of supported + configuration. Explicitly supplied configuration takes precedence + over discovered values. skip_embedding_retrieval: When True, skips embedding-based retrieval. organization_custom_instructions: Organization-level custom instructions. enable_on_demand_instruction_discovery: Enables on-demand instruction file @@ -2761,13 +2757,9 @@ async def resume_session( including tool visibility controls. agent: Agent to use for the session. config_directory: Override for the configuration directory. - enable_config_discovery: When True, automatically discovers MCP server - configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill - directories from the working directory and merges them with any - explicitly provided ``mcp_servers`` and ``skill_directories``, with - explicit values taking precedence on name collision. Custom instruction - files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are - always loaded regardless of this setting. + enable_config_discovery: Enables runtime discovery of supported + configuration. Explicitly supplied configuration takes precedence + over discovered values. skip_embedding_retrieval: When True, skips embedding-based retrieval. organization_custom_instructions: Organization-level custom instructions. enable_on_demand_instruction_discovery: Enables on-demand instruction file diff --git a/rust/src/types.rs b/rust/src/types.rs index 028702655..8c2b867b3 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1724,7 +1724,8 @@ pub struct SessionConfig { /// applied automatically at session creation/resume time. `None` means no /// explicit value is set and the runtime default takes effect. pub mcp_oauth_token_storage: Option, - /// When true, the CLI runs config discovery (MCP config files, skills, plugins). + /// Enables runtime discovery of supported configuration. Explicitly supplied + /// configuration takes precedence over discovered values. pub enable_config_discovery: Option, /// When true, skips embedding retrieval for this session. pub skip_embedding_retrieval: Option, @@ -2579,7 +2580,8 @@ impl SessionConfig { self } - /// Enable or disable CLI config discovery (MCP config files, skills, plugins). + /// Enables runtime discovery of supported configuration. Explicitly supplied + /// configuration takes precedence over discovered values. pub fn with_enable_config_discovery(mut self, enable: bool) -> Self { self.enable_config_discovery = Some(enable); self @@ -2949,7 +2951,8 @@ pub struct ResumeSessionConfig { /// Controls how MCP OAuth tokens are stored for this session. /// See [`SessionConfig::mcp_oauth_token_storage`] for details. pub mcp_oauth_token_storage: Option, - /// Enable config discovery on resume. + /// Enables runtime discovery of supported configuration. Explicitly supplied + /// configuration takes precedence over discovered values. pub enable_config_discovery: Option, /// When true, skips embedding retrieval on resume. pub skip_embedding_retrieval: Option, @@ -3703,7 +3706,8 @@ impl ResumeSessionConfig { self } - /// Enable or disable CLI config discovery on resume. + /// Enables runtime discovery of supported configuration. Explicitly supplied + /// configuration takes precedence over discovered values. pub fn with_enable_config_discovery(mut self, enable: bool) -> Self { self.enable_config_discovery = Some(enable); self