Skip to content

docs: fix EnableConfigDiscovery summary to accurately describe agent discovery behavior - #2019

Merged
SteveSandersonMS merged 2 commits into
github:mainfrom
smz202000:fix/enable-config-discovery-doc
Jul 30, 2026
Merged

docs: fix EnableConfigDiscovery summary to accurately describe agent discovery behavior#2019
SteveSandersonMS merged 2 commits into
github:mainfrom
smz202000:fix/enable-config-discovery-doc

Conversation

@smz202000

Copy link
Copy Markdown
Contributor

Summary

Fixes #1887

The previous documentation for EnableConfigDiscovery incorrectly stated that custom instruction files are "always loaded from the working directory regardless of this setting." In practice, agent files (e.g. .github/agents/) are only discovered when EnableConfigDiscovery is true.

Changes

Updated the XML doc comment on SessionConfig.EnableConfigDiscovery in dotnet/src/Types.cs to:

  1. Clarify that agent discovery is gated by EnableConfigDiscovery
  2. Reference SkipCustomInstructions as the independent control for instruction file loading

Before:

/// <para>
/// Custom instruction files (.github/copilot-instructions.md, AGENTS.md, etc.)
/// are always loaded from the working directory regardless of this setting.
/// </para>

After:

/// <para>
/// Agent discovery (e.g. .github/agents/) is only performed when this is
/// true. Use SkipCustomInstructions to control
/// loading of custom instruction files independently.
/// </para>

…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 github#1887
@smz202000
smz202000 requested a review from a team as a code owner July 17, 2026 08:07
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 (github#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 github#1887

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@SteveSandersonMS SteveSandersonMS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and extended this PR to apply one consistent EnableConfigDiscovery description across all 6 SDKs (dotnet/go/nodejs/python/rust/java), replacing per-language wording that varied and, in 4 languages, incorrectly claimed custom instruction files are always loaded regardless of this setting.

Validation performed:

  • Built/typechecked dotnet (net8.0), rust (cargo build), nodejs (tsc --noEmit), python (ruff check) — all clean. Go/Java toolchains unavailable locally but changes are comment-only with balanced braces verified.
  • Manually reproduced the underlying behavior against a live copilot CLI runtime: with EnableConfigDiscovery=false, .github/agents/*.agent.md is NOT discovered (agent.list() returns []); with true it is. Separately confirmed AGENTS.md content is loaded into the model's context even when EnableConfigDiscovery=false (model referenced the exact planted marker as a 'custom_instruction').
  • Full CI matrix (58 checks) passed across all languages after approving the required workflow runs.

@SteveSandersonMS
SteveSandersonMS added this pull request to the merge queue Jul 30, 2026
Merged via the queue into github:main with commit 8a36705 Jul 30, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EnableConfigDiscovery - Incorrect Behaviour

2 participants