Skip to content

Add customAgentDirectories session config option - #2362

Draft
timrogers wants to merge 1 commit into
mainfrom
timrogers-custom-agent-directories
Draft

Add customAgentDirectories session config option#2362
timrogers wants to merge 1 commit into
mainfrom
timrogers-custom-agent-directories

Conversation

@timrogers

Copy link
Copy Markdown

What

Adds a customAgentDirectories option to the session config across all six SDK languages (Node/TS, Go, Python, .NET, Java, Rust), mirroring the existing instructionDirectories / skillDirectories passthrough options. It accepts a list of directory paths that the CLI searches for custom agent definition files (*.agent.md), forwarded on both session create and resume.

Per language:

  • nodejs: SessionConfigBase.customAgentDirectories + create/resume forwarding
  • go: SessionConfig / ResumeSessionConfig + request structs + forwarding
  • python: create_session / resume_session custom_agent_directories param
  • dotnet: SessionConfig.CustomAgentDirectories + Clone + create/resume/update
  • java: SessionConfig / ResumeSessionConfig + request builders
  • rust: SessionConfig::with_custom_agent_directories + create/resume wire

Why

Callers need a way to point the CLI at additional directories containing custom agent definitions, consistent with the existing skill and instruction directory options. This closes that gap in the SDK surface.

Testing

  • Unit tests (all languages) verify the option is forwarded on the session.create and session.resume JSON-RPC requests.
  • End-to-end tests (with handcrafted replay-proxy snapshots under test/snapshots/session_config/) additionally assert that a custom agent placed in a customAgentDirectories path is discovered by the CLI and surfaced in the task tool's agent_type enum, on both create and resume.

Note: The E2E tests depend on a corresponding CLI/runtime change (customAgentDirectories forwarded-key + opt-in discovery gating) in copilot-agent-runtime. That change must ship in the bundled CLI before these E2E tests pass against a published @github/copilot.

var dirs = List.of("/path/to/agents", "/another/agents");
var config = new SessionConfig().setCustomAgentDirectories(dirs);

CreateSessionRequest request = SessionRequestBuilder.buildCreateRequest(config);
@github-actions

This comment has been minimized.

@timrogers
timrogers force-pushed the timrogers-custom-agent-directories branch from e58349c to 6d4af83 Compare August 19, 2026 20:20
@github-actions

This comment has been minimized.

Add a `customAgentDirectories` option to the session config across all six
SDK languages, mirroring the existing `instructionDirectories` /
`skillDirectories` passthrough options. It accepts a list of directory paths
that the CLI searches for custom agent definition files, forwarded on both
session create and resume.

- nodejs: SessionConfigBase.customAgentDirectories + create/resume forwarding
- go: SessionConfig/ResumeSessionConfig + request structs + forwarding
- python: create_session/resume_session custom_agent_directories param
- dotnet: SessionConfig.CustomAgentDirectories + Clone + create/resume/update
- java: SessionConfig/ResumeSessionConfig + request builders
- rust: SessionConfig::with_custom_agent_directories + create/resume wire

Unit tests verify the option is forwarded on the session.create and
session.resume JSON-RPC requests in every language. End-to-end tests (with
handcrafted replay-proxy snapshots) additionally assert that a custom agent
placed in a `customAgentDirectories` path is discovered by the CLI and
surfaced in the task tool's `agent_type` enum, on both create and resume.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d4c94c34-dda4-49a1-b876-687fc771d0e0
@timrogers
timrogers force-pushed the timrogers-custom-agent-directories branch from 6d4af83 to 1eddcfb Compare August 19, 2026 20:34
@github-actions

Copy link
Copy Markdown
Contributor

✅ Cross-SDK Consistency Review

This PR adds customAgentDirectories to the session config across all six SDK implementations. I reviewed the PR diff for cross-language consistency.

Coverage

SDK Implementation Unit Tests E2E Tests
Node.js/TypeScript customAgentDirectories in SessionConfigBase + forwarding
Python custom_agent_directories param on create/resume
Go CustomAgentDirectories in SessionConfig/ResumeSessionConfig
.NET CustomAgentDirectories in SessionConfigBase + clone/create/resume
Java SessionConfig/ResumeSessionConfig + request builders
Rust with_custom_agent_directories + create/resume wire

API Naming Consistency

Naming follows each language's conventions correctly:

  • TypeScript/Java: customAgentDirectories (camelCase)
  • Python: custom_agent_directories (snake_case)
  • Go/.NET: CustomAgentDirectories (PascalCase)
  • Rust: with_custom_agent_directories (snake_case)

All SDKs forward the option on both session.create and session.resume JSON-RPC calls, consistent with how instructionDirectories is handled.

No consistency issues found. The PR maintains full feature parity across all six SDK implementations.

Generated by SDK Consistency Review Agent for #2362 · sonnet46 28.6 AIC · ⌖ 6.94 AIC · ⊞ 6.6K ·

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.

2 participants