Skip to content

Commit 773de57

Browse files
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>
1 parent 2901b99 commit 773de57

7 files changed

Lines changed: 26 additions & 61 deletions

File tree

dotnet/src/Types.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2977,16 +2977,8 @@ protected SessionConfigBase(SessionConfigBase? other)
29772977
public string? ConfigDirectory { get; set; }
29782978

29792979
/// <summary>
2980-
/// When <see langword="true"/>, automatically discovers MCP server configurations
2981-
/// (e.g. <c>.mcp.json</c>, <c>.vscode/mcp.json</c>) and skill directories from
2982-
/// the working directory and merges them with any explicitly provided
2983-
/// <see cref="McpServers"/> and <see cref="SkillDirectories"/>, with explicit
2984-
/// values taking precedence on name collision.
2985-
/// <para>
2986-
/// Agent discovery (e.g. <c>.github/agents/</c>) is only performed when this is
2987-
/// <see langword="true"/>. Use <see cref="SkipCustomInstructions"/> to control
2988-
/// loading of custom instruction files independently.
2989-
/// </para>
2980+
/// Enables runtime discovery of supported configuration. Explicitly supplied
2981+
/// configuration takes precedence over discovered values.
29902982
/// </summary>
29912983
public bool? EnableConfigDiscovery { get; set; }
29922984

go/types.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,13 +1052,9 @@ type SessionConfig struct {
10521052
// ConfigDirectory overrides the default configuration directory location.
10531053
// When specified, the session will use this directory for storing config and state.
10541054
ConfigDirectory string
1055-
// EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations
1056-
// (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory
1057-
// and merges them with any explicitly provided MCPServers and SkillDirectories, with
1058-
// explicit values taking precedence on name collision.
1055+
// EnableConfigDiscovery enables runtime discovery of supported configuration.
1056+
// Explicitly supplied configuration takes precedence over discovered values.
10591057
// Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery.
1060-
// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are
1061-
// always loaded from the working directory regardless of this setting.
10621058
EnableConfigDiscovery *bool
10631059
// SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval
10641060
// for this session. Use in multitenant deployments to prevent cross-session
@@ -1611,13 +1607,9 @@ type ResumeSessionConfig struct {
16111607
WorkingDirectory string
16121608
// ConfigDirectory overrides the default configuration directory location.
16131609
ConfigDirectory string
1614-
// EnableConfigDiscovery, when non-nil, controls automatic discovery of MCP server configurations
1615-
// (e.g. .mcp.json, .vscode/mcp.json) and skill directories from the working directory
1616-
// and merges them with any explicitly provided MCPServers and SkillDirectories, with
1617-
// explicit values taking precedence on name collision.
1610+
// EnableConfigDiscovery enables runtime discovery of supported configuration.
1611+
// Explicitly supplied configuration takes precedence over discovered values.
16181612
// Nil leaves the runtime default unchanged; use Bool(false) to explicitly disable discovery.
1619-
// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.) are
1620-
// always loaded from the working directory regardless of this setting.
16211613
EnableConfigDiscovery *bool
16221614
// SkipEmbeddingRetrieval, when non-nil, controls embedding-based retrieval
16231615
// 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
@@ -848,12 +848,8 @@ public Optional<Boolean> getEnableConfigDiscovery() {
848848
}
849849

850850
/**
851-
* Sets whether to automatically discover MCP server configurations and skill
852-
* directories from the working directory.
853-
* <p>
854-
* When {@code true}, the CLI scans the working directory for {@code .mcp.json},
855-
* {@code .vscode/mcp.json} and skill directories, and merges them with
856-
* explicitly provided configurations.
851+
* Enables runtime discovery of supported configuration. Explicitly supplied
852+
* configuration takes precedence over discovered values.
857853
*
858854
* @param enableConfigDiscovery
859855
* {@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
@@ -1235,14 +1235,8 @@ public Optional<Boolean> getEnableConfigDiscovery() {
12351235
}
12361236

12371237
/**
1238-
* Sets whether to automatically discover MCP server configurations and skill
1239-
* directories from the working directory.
1240-
* <p>
1241-
* When {@code true}, the CLI scans the working directory for {@code .mcp.json},
1242-
* {@code .vscode/mcp.json} and skill directories, and merges them with
1243-
* explicitly provided {@link #setMcpServers(Map)} and
1244-
* {@link #setSkillDirectories(List)}, with explicit values taking precedence on
1245-
* name collision.
1238+
* Enables runtime discovery of supported configuration. Explicitly supplied
1239+
* configuration takes precedence over discovered values.
12461240
*
12471241
* @param enableConfigDiscovery
12481242
* {@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
@@ -1915,13 +1915,8 @@ export interface SessionConfigBase {
19151915
configDirectory?: string;
19161916

19171917
/**
1918-
* When true, automatically discovers MCP server configurations (e.g. `.mcp.json`,
1919-
* `.vscode/mcp.json`) and skill directories from the working directory and merges
1920-
* them with any explicitly provided `mcpServers` and `skillDirectories`, with
1921-
* explicit values taking precedence on name collision.
1922-
*
1923-
* Note: custom instruction files (`.github/copilot-instructions.md`, `AGENTS.md`, etc.)
1924-
* are always loaded from the working directory regardless of this setting.
1918+
* Enables runtime discovery of supported configuration. Explicitly supplied
1919+
* configuration takes precedence over discovered values.
19251920
*
19261921
* @default false
19271922
*/

python/copilot/client.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,13 +2088,9 @@ async def create_session(
20882088
including tool visibility controls.
20892089
agent: Agent to use for the session.
20902090
config_directory: Override for the configuration directory.
2091-
enable_config_discovery: When True, automatically discovers MCP server
2092-
configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill
2093-
directories from the working directory and merges them with any
2094-
explicitly provided ``mcp_servers`` and ``skill_directories``, with
2095-
explicit values taking precedence on name collision. Custom instruction
2096-
files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are
2097-
always loaded regardless of this setting.
2091+
enable_config_discovery: Enables runtime discovery of supported
2092+
configuration. Explicitly supplied configuration takes precedence
2093+
over discovered values.
20982094
skip_embedding_retrieval: When True, skips embedding-based retrieval.
20992095
organization_custom_instructions: Organization-level custom instructions.
21002096
enable_on_demand_instruction_discovery: Enables on-demand instruction file
@@ -2761,13 +2757,9 @@ async def resume_session(
27612757
including tool visibility controls.
27622758
agent: Agent to use for the session.
27632759
config_directory: Override for the configuration directory.
2764-
enable_config_discovery: When True, automatically discovers MCP server
2765-
configurations (e.g. ``.mcp.json``, ``.vscode/mcp.json``) and skill
2766-
directories from the working directory and merges them with any
2767-
explicitly provided ``mcp_servers`` and ``skill_directories``, with
2768-
explicit values taking precedence on name collision. Custom instruction
2769-
files (``.github/copilot-instructions.md``, ``AGENTS.md``, etc.) are
2770-
always loaded regardless of this setting.
2760+
enable_config_discovery: Enables runtime discovery of supported
2761+
configuration. Explicitly supplied configuration takes precedence
2762+
over discovered values.
27712763
skip_embedding_retrieval: When True, skips embedding-based retrieval.
27722764
organization_custom_instructions: Organization-level custom instructions.
27732765
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
@@ -1724,7 +1724,8 @@ pub struct SessionConfig {
17241724
/// applied automatically at session creation/resume time. `None` means no
17251725
/// explicit value is set and the runtime default takes effect.
17261726
pub mcp_oauth_token_storage: Option<String>,
1727-
/// When true, the CLI runs config discovery (MCP config files, skills, plugins).
1727+
/// Enables runtime discovery of supported configuration. Explicitly supplied
1728+
/// configuration takes precedence over discovered values.
17281729
pub enable_config_discovery: Option<bool>,
17291730
/// When true, skips embedding retrieval for this session.
17301731
pub skip_embedding_retrieval: Option<bool>,
@@ -2579,7 +2580,8 @@ impl SessionConfig {
25792580
self
25802581
}
25812582

2582-
/// Enable or disable CLI config discovery (MCP config files, skills, plugins).
2583+
/// Enables runtime discovery of supported configuration. Explicitly supplied
2584+
/// configuration takes precedence over discovered values.
25832585
pub fn with_enable_config_discovery(mut self, enable: bool) -> Self {
25842586
self.enable_config_discovery = Some(enable);
25852587
self
@@ -2949,7 +2951,8 @@ pub struct ResumeSessionConfig {
29492951
/// Controls how MCP OAuth tokens are stored for this session.
29502952
/// See [`SessionConfig::mcp_oauth_token_storage`] for details.
29512953
pub mcp_oauth_token_storage: Option<String>,
2952-
/// Enable config discovery on resume.
2954+
/// Enables runtime discovery of supported configuration. Explicitly supplied
2955+
/// configuration takes precedence over discovered values.
29532956
pub enable_config_discovery: Option<bool>,
29542957
/// When true, skips embedding retrieval on resume.
29552958
pub skip_embedding_retrieval: Option<bool>,
@@ -3703,7 +3706,8 @@ impl ResumeSessionConfig {
37033706
self
37043707
}
37053708

3706-
/// Enable or disable CLI config discovery on resume.
3709+
/// Enables runtime discovery of supported configuration. Explicitly supplied
3710+
/// configuration takes precedence over discovered values.
37073711
pub fn with_enable_config_discovery(mut self, enable: bool) -> Self {
37083712
self.enable_config_discovery = Some(enable);
37093713
self

0 commit comments

Comments
 (0)