Skip to content

Commit 8a36705

Browse files
smz202000SteveSandersonMSCopilot
authored
docs: fix EnableConfigDiscovery summary to accurately describe agent discovery behavior (#2019)
* 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 * 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> --------- Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9266cf4 commit 8a36705

7 files changed

Lines changed: 26 additions & 60 deletions

File tree

dotnet/src/Types.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,15 +3101,8 @@ protected SessionConfigBase(SessionConfigBase? other)
31013101
public string? ConfigDirectory { get; set; }
31023102

31033103
/// <summary>
3104-
/// When <see langword="true"/>, automatically discovers MCP server configurations
3105-
/// (e.g. <c>.mcp.json</c>, <c>.vscode/mcp.json</c>) and skill directories from
3106-
/// the working directory and merges them with any explicitly provided
3107-
/// <see cref="McpServers"/> and <see cref="SkillDirectories"/>, with explicit
3108-
/// values taking precedence on name collision.
3109-
/// <para>
3110-
/// Custom instruction files (<c>.github/copilot-instructions.md</c>, <c>AGENTS.md</c>, etc.)
3111-
/// are always loaded from the working directory regardless of this setting.
3112-
/// </para>
3104+
/// Enables runtime discovery of supported configuration. Explicitly supplied
3105+
/// configuration takes precedence over discovered values.
31133106
/// </summary>
31143107
public bool? EnableConfigDiscovery { get; set; }
31153108

go/types.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,13 +1162,9 @@ type SessionConfig struct {
11621162
// ConfigDirectory overrides the default configuration directory location.
11631163
// When specified, the session will use this directory for storing config and state.
11641164
ConfigDirectory string
1165-
// EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations
1166-
// (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory
1167-
// and merges them with any explicitly provided MCPServers and SkillDirectories, with
1168-
// explicit values taking precedence on name collision.
1165+
// EnableConfigDiscovery enables runtime discovery of supported configuration.
1166+
// Explicitly supplied configuration takes precedence over discovered values.
11691167
// Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery.
1170-
// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are
1171-
// always loaded from the working directory regardless of this setting.
11721168
EnableConfigDiscovery *bool
11731169
// SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval
11741170
// for this session. Use in multitenant deployments to prevent cross-session
@@ -1721,13 +1717,9 @@ type ResumeSessionConfig struct {
17211717
WorkingDirectory string
17221718
// ConfigDirectory overrides the default configuration directory location.
17231719
ConfigDirectory string
1724-
// EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations
1725-
// (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory
1726-
// and merges them with any explicitly provided MCPServers and SkillDirectories, with
1727-
// explicit values taking precedence on name collision.
1720+
// EnableConfigDiscovery enables runtime discovery of supported configuration.
1721+
// Explicitly supplied configuration takes precedence over discovered values.
17281722
// Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery.
1729-
// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are
1730-
// always loaded from the working directory regardless of this setting.
17311723
EnableConfigDiscovery *bool
17321724
// SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval
17331725
// for this session. Use in multitenant deployments to prevent cross-session

java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,12 +847,8 @@ public Optional<Boolean> getEnableConfigDiscovery() {
847847
}
848848

849849
/**
850-
* Sets whether to automatically discover MCP server configurations and skill
851-
* directories from the working directory.
852-
* <p>
853-
* When {@code true}, the CLI scans the working directory for {@code .mcp.json},
854-
* {@code .vscode/mcp.json} and skill directories, and merges them with
855-
* explicitly provided configurations.
850+
* Enables runtime discovery of supported configuration. Explicitly supplied
851+
* configuration takes precedence over discovered values.
856852
*
857853
* @param enableConfigDiscovery
858854
* {@code true} to enable discovery, {@code false} to disable

java/src/main/java/com/github/copilot/rpc/SessionConfig.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,14 +1234,8 @@ public Optional<Boolean> getEnableConfigDiscovery() {
12341234
}
12351235

12361236
/**
1237-
* Sets whether to automatically discover MCP server configurations and skill
1238-
* directories from the working directory.
1239-
* <p>
1240-
* When {@code true}, the CLI scans the working directory for {@code .mcp.json},
1241-
* {@code .vscode/mcp.json} and skill directories, and merges them with
1242-
* explicitly provided {@link #setMcpServers(Map)} and
1243-
* {@link #setSkillDirectories(List)}, with explicit values taking precedence on
1244-
* name collision.
1237+
* Enables runtime discovery of supported configuration. Explicitly supplied
1238+
* configuration takes precedence over discovered values.
12451239
*
12461240
* @param enableConfigDiscovery
12471241
* {@code true} to enable discovery, {@code false} to disable

nodejs/src/types.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,13 +2010,8 @@ export interface SessionConfigBase {
20102010
configDirectory?: string;
20112011

20122012
/**
2013-
* When true, automatically discovers MCP server configurations (e.g. `.mcp.json`,
2014-
* `.vscode/mcp.json`) and skill directories from the working directory and merges
2015-
* them with any explicitly provided `mcpServers` and `skillDirectories`, with
2016-
* explicit values taking precedence on name collision.
2017-
*
2018-
* Note: custom instruction files (`.github/copilot-instructions.md`, `AGENTS.md`, etc.)
2019-
* are always loaded from the working directory regardless of this setting.
2013+
* Enables runtime discovery of supported configuration. Explicitly supplied
2014+
* configuration takes precedence over discovered values.
20202015
*
20212016
* @default false
20222017
*/

python/copilot/client.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,13 +2153,9 @@ async def create_session(
21532153
including tool visibility controls.
21542154
agent: Agent to use for the session.
21552155
config_directory: Override for the configuration directory.
2156-
enable_config_discovery: When True, automatically discovers MCP server
2157-
configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill
2158-
directories from the working directory and merges them with any
2159-
explicitly provided ``mcp_servers`` and ``skill_directories``, with
2160-
explicit values taking precedence on name collision. Custom instruction
2161-
files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are
2162-
always loaded regardless of this setting.
2156+
enable_config_discovery: Enables runtime discovery of supported
2157+
configuration. Explicitly supplied configuration takes precedence
2158+
over discovered values.
21632159
skip_embedding_retrieval: When True, skips embedding-based retrieval.
21642160
organization_custom_instructions: Organization-level custom instructions.
21652161
enable_on_demand_instruction_discovery: Enables on-demand instruction file
@@ -2826,13 +2822,9 @@ async def resume_session(
28262822
including tool visibility controls.
28272823
agent: Agent to use for the session.
28282824
config_directory: Override for the configuration directory.
2829-
enable_config_discovery: When True, automatically discovers MCP server
2830-
configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill
2831-
directories from the working directory and merges them with any
2832-
explicitly provided ``mcp_servers`` and ``skill_directories``, with
2833-
explicit values taking precedence on name collision. Custom instruction
2834-
files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are
2835-
always loaded regardless of this setting.
2825+
enable_config_discovery: Enables runtime discovery of supported
2826+
configuration. Explicitly supplied configuration takes precedence
2827+
over discovered values.
28362828
skip_embedding_retrieval: When True, skips embedding-based retrieval.
28372829
organization_custom_instructions: Organization-level custom instructions.
28382830
enable_on_demand_instruction_discovery: Enables on-demand instruction file

rust/src/types.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,8 @@ pub struct SessionConfig {
17861786
/// applied automatically at session creation/resume time. `None` means no
17871787
/// explicit value is set and the runtime default takes effect.
17881788
pub mcp_oauth_token_storage: Option<String>,
1789-
/// When true, the CLI runs config discovery (MCP config files, skills, plugins).
1789+
/// Enables runtime discovery of supported configuration. Explicitly supplied
1790+
/// configuration takes precedence over discovered values.
17901791
pub enable_config_discovery: Option<bool>,
17911792
/// When true, skips embedding retrieval for this session.
17921793
pub skip_embedding_retrieval: Option<bool>,
@@ -2641,7 +2642,8 @@ impl SessionConfig {
26412642
self
26422643
}
26432644

2644-
/// Enable or disable CLI config discovery (MCP config files, skills, plugins).
2645+
/// Enables runtime discovery of supported configuration. Explicitly supplied
2646+
/// configuration takes precedence over discovered values.
26452647
pub fn with_enable_config_discovery(mut self, enable: bool) -> Self {
26462648
self.enable_config_discovery = Some(enable);
26472649
self
@@ -3011,7 +3013,8 @@ pub struct ResumeSessionConfig {
30113013
/// Controls how MCP OAuth tokens are stored for this session.
30123014
/// See [`SessionConfig::mcp_oauth_token_storage`] for details.
30133015
pub mcp_oauth_token_storage: Option<String>,
3014-
/// Enable config discovery on resume.
3016+
/// Enables runtime discovery of supported configuration. Explicitly supplied
3017+
/// configuration takes precedence over discovered values.
30153018
pub enable_config_discovery: Option<bool>,
30163019
/// When true, skips embedding retrieval on resume.
30173020
pub skip_embedding_retrieval: Option<bool>,
@@ -3765,7 +3768,8 @@ impl ResumeSessionConfig {
37653768
self
37663769
}
37673770

3768-
/// Enable or disable CLI config discovery on resume.
3771+
/// Enables runtime discovery of supported configuration. Explicitly supplied
3772+
/// configuration takes precedence over discovered values.
37693773
pub fn with_enable_config_discovery(mut self, enable: bool) -> Self {
37703774
self.enable_config_discovery = Some(enable);
37713775
self

0 commit comments

Comments
 (0)