Add instructionDirectories session config support#1190
Conversation
Expose the runtime instructionDirectories session option across the SDKs and cover create/resume forwarding with unit and E2E tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR exposes the runtime’s new instructionDirectories session option across the supported SDKs so callers can provide additional instruction search roots consistently when creating or resuming sessions. It fits into the SDK layer by threading a new session-level configuration field through each language’s public API, request serialization, and cross-language test coverage.
Changes:
- Add
instructionDirectoriesto the public session configuration surface for Node.js, Python, Go, and .NET. - Forward the new option into
session.createandsession.resumeJSON-RPC payloads in each SDK. - Add unit/E2E coverage plus replay snapshots validating create/resume behavior with instruction directory fixtures.
Show a summary per file
| File | Description |
|---|---|
test/snapshots/session_config/should_apply_instructiondirectories_on_session_resume.yaml |
Snapshot for one language’s resume E2E instruction-directory case. |
test/snapshots/session_config/should_apply_instructiondirectories_on_session_create.yaml |
Snapshot for one language’s create E2E instruction-directory case. |
test/snapshots/session_config/should_apply_instructiondirectories_on_resume.yaml |
Snapshot for another language’s resume E2E case. |
test/snapshots/session_config/should_apply_instructiondirectories_on_create.yaml |
Snapshot for another language’s create E2E case. |
test/snapshots/session_config/should_apply_instruction_directories_on_resume.yaml |
Snapshot for Python-style resume test naming. |
test/snapshots/session_config/should_apply_instruction_directories_on_create.yaml |
Snapshot for Python-style create test naming. |
python/test_client.py |
Adds Python unit tests for request forwarding. |
python/e2e/test_session_config_e2e.py |
Adds Python E2E coverage for create/resume instruction directories. |
python/copilot/session.py |
Extends Python session config TypedDicts with the new option. |
python/copilot/client.py |
Threads Python API args into create/resume payloads and docs. |
nodejs/test/e2e/session_config.e2e.test.ts |
Adds Node E2E coverage for create/resume instruction directories. |
nodejs/test/client.test.ts |
Adds Node unit tests verifying request forwarding. |
nodejs/src/types.ts |
Exposes the new field in Node session config types. |
nodejs/src/client.ts |
Sends instructionDirectories in Node create/resume RPC requests. |
go/types.go |
Adds Go public config fields and wire request fields. |
go/internal/e2e/session_config_e2e_test.go |
Adds Go E2E coverage for create/resume instruction directories. |
go/client_test.go |
Adds Go serialization tests for the new request field. |
go/client.go |
Threads Go config values into create/resume requests. |
dotnet/test/Unit/SerializationTests.cs |
Adds .NET serialization tests for instruction directories. |
dotnet/test/Unit/CloneTests.cs |
Verifies .NET clone behavior copies the new collection. |
dotnet/test/E2E/SessionConfigE2ETests.cs |
Adds .NET E2E coverage for create/resume instruction directories. |
dotnet/src/Types.cs |
Adds .NET public config properties and clone support. |
dotnet/src/Client.cs |
Sends InstructionDirectories in .NET create/resume RPC requests. |
Copilot's findings
- Files reviewed: 23/23 changed files
- Comments generated: 0
Cross-SDK Consistency Review ✅This PR does an excellent job of adding
Naming conventions, JSON wire key ( Minor observation (non-blocking)In # skill_directories: falsy check — an empty list [] is NOT sent
if skill_directories:
payload["skillDirectories"] = skill_directories
# instruction_directories: None check — an empty list [] IS sent
if instruction_directories is not None:
payload["instructionDirectories"] = instruction_directoriesIf the runtime treats
|
The runtime added an
instructionDirectoriesoption for session create and resume requests, but the SDKs did not expose it yet. This PR threads that session-level option through each language SDK so callers can provide additional custom instruction directories consistently.Summary
session.createandsession.resumeJSON-RPC payloads..github/instructions/*.instructions.mdfixtures.