Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nodejs/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ export class CopilotClient {
customAgents: config.customAgents,
agent: config.agent,
configDir: config.configDir,
loadCliConfig: config.loadCliConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

Cross-SDK consistency: This field forwarding needs equivalent implementation in:

  • Python: Add if load_cli_config: payload["loadCliConfig"] = load_cli_config in client.py (around line 745)
  • Go: Add req.LoadCliConfig = config.LoadCliConfig in CreateSession method in client.go
  • .NET: Add config.LoadCliConfig parameter to CreateSessionRequest constructor in Client.cs

skillDirectories: config.skillDirectories,
disabledSkills: config.disabledSkills,
infiniteSessions: config.infiniteSessions,
Expand Down Expand Up @@ -722,6 +723,7 @@ export class CopilotClient {
envValueMode: "direct",
customAgents: config.customAgents,
agent: config.agent,
loadCliConfig: config.loadCliConfig,
Copy link
Contributor

Choose a reason for hiding this comment

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

Cross-SDK consistency: Resume session forwarding needs equivalent implementation in:

  • Python: Add the same loadCliConfig forwarding in the resume session payload construction (around line 745)
  • Go: Add req.LoadCliConfig = config.LoadCliConfig in ResumeSessionWithOptions method
  • .NET: Add config.LoadCliConfig parameter to ResumeSessionRequest constructor

skillDirectories: config.skillDirectories,
disabledSkills: config.disabledSkills,
infiniteSessions: config.infiniteSessions,
Expand Down
10 changes: 10 additions & 0 deletions nodejs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,15 @@ export interface SessionConfig {
*/
configDir?: string;

/**
* When true, the runtime loads CLI-style extensibility from the current environment.
* This includes merged MCP config, default GitHub MCP behavior, skills, custom agents,
* installed plugins, and other config-backed session options.
* Explicit per-request settings are merged on top of discovered config.
* @default false
*/
loadCliConfig?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Cross-SDK consistency: This new field needs equivalent implementation in:

  • Python: Add load_cli_config: bool to SessionConfig in python/copilot/types.py
  • Go: Add LoadCliConfig bool to SessionConfig in go/types.go
  • .NET: Add public bool? LoadCliConfig { get; set; } to SessionConfig in dotnet/src/Types.cs


/**
* Tools exposed to the CLI server
*/
Expand Down Expand Up @@ -865,6 +874,7 @@ export type ResumeSessionConfig = Pick<
| "hooks"
| "workingDirectory"
| "configDir"
| "loadCliConfig"
Copy link
Contributor

Choose a reason for hiding this comment

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

Cross-SDK consistency: The ResumeSessionConfig type needs similar updates in other SDKs. Note that:

  • Go has ResumeSessionConfig as a separate struct in types.go
  • Python reuses SessionConfig for resume
  • .NET has ResumeSessionConfig class in Types.cs

Each should include the equivalent of loadCliConfig in their resume configuration.

| "mcpServers"
| "customAgents"
| "agent"
Expand Down
40 changes: 40 additions & 0 deletions nodejs/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,46 @@ describe("CopilotClient", () => {
spy.mockRestore();
});

it("forwards loadCliConfig in session.create request", async () => {
const client = new CopilotClient();
await client.start();
onTestFinished(() => client.forceStop());

const spy = vi.spyOn((client as any).connection!, "sendRequest");
await client.createSession({ loadCliConfig: true, onPermissionRequest: approveAll });

expect(spy).toHaveBeenCalledWith(
"session.create",
expect.objectContaining({ loadCliConfig: true })
);
spy.mockRestore();
});

it("forwards loadCliConfig in session.resume request", async () => {
const client = new CopilotClient();
await client.start();
onTestFinished(() => client.forceStop());

const session = await client.createSession({ onPermissionRequest: approveAll });
const spy = vi
.spyOn((client as any).connection!, "sendRequest")
.mockImplementation(async (method: string, params: any) => {
if (method === "session.resume") return { sessionId: params.sessionId };
throw new Error(`Unexpected method: ${method}`);
});

await client.resumeSession(session.sessionId, {
loadCliConfig: true,
onPermissionRequest: approveAll,
});

expect(spy).toHaveBeenCalledWith(
"session.resume",
expect.objectContaining({ sessionId: session.sessionId, loadCliConfig: true })
);
spy.mockRestore();
});

it("sends session.model.switchTo RPC with correct params", async () => {
const client = new CopilotClient();
await client.start();
Expand Down
Loading