Skip to content

Commit 09dada7

Browse files
Phase L follow-up: run prettier --write over all modified files
Prettier check failed on Ubuntu CI because several files modified in earlier phases didn't get re-formatted after the bulk regex rewrites. Running 'npm run format' (prettier --write) normalizes them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 659936e commit 09dada7

8 files changed

Lines changed: 47 additions & 15 deletions

nodejs/src/client.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ export class CopilotClient {
333333
// Resolve the connection mode. `_internalConnection` is set by
334334
// `joinSession()` to opt into the parent-process stdio path; consumers
335335
// should always go through the public `connection` field.
336-
const conn: InternalRuntimeConnection =
337-
options._internalConnection ?? options.connection ?? { kind: "stdio" };
336+
const conn: InternalRuntimeConnection = options._internalConnection ??
337+
options.connection ?? { kind: "stdio" };
338338

339339
if (
340340
conn.kind === "uri" &&
@@ -2059,7 +2059,10 @@ export class CopilotClient {
20592059
throw new Error(`Session not found: ${params.sessionId}`);
20602060
}
20612061

2062-
const output = await session._handleHooksInvoke(params.hookType, normalizeHookInput(params.input));
2062+
const output = await session._handleHooksInvoke(
2063+
params.hookType,
2064+
normalizeHookInput(params.input)
2065+
);
20632066
return { output };
20642067
}
20652068

nodejs/test/client.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { defaultJoinSessionPermissionHandler } from "../src/types.js";
88

99
describe("CopilotClient", () => {
1010
it("allows createSession without onPermissionRequest", async () => {
11-
const client = new CopilotClient({ });
11+
const client = new CopilotClient({});
1212

1313
await expect(client.createSession({})).rejects.toThrow(/Client not connected/);
1414
});
1515

1616
it("allows resumeSession without onPermissionRequest", async () => {
17-
const client = new CopilotClient({ });
17+
const client = new CopilotClient({});
1818

1919
await expect(client.resumeSession("session-1", {})).rejects.toThrow(/Client not connected/);
2020
});
@@ -752,7 +752,9 @@ describe("CopilotClient", () => {
752752
gitHubToken: "gho_test_token",
753753
logLevel: "error",
754754
});
755-
}).toThrow(/gitHubToken and useLoggedInUser cannot be used with RuntimeConnection.forUri/);
755+
}).toThrow(
756+
/gitHubToken and useLoggedInUser cannot be used with RuntimeConnection.forUri/
757+
);
756758
});
757759

758760
it("should throw error when useLoggedInUser is used with forUri", () => {
@@ -762,7 +764,9 @@ describe("CopilotClient", () => {
762764
useLoggedInUser: false,
763765
logLevel: "error",
764766
});
765-
}).toThrow(/gitHubToken and useLoggedInUser cannot be used with RuntimeConnection.forUri/);
767+
}).toThrow(
768+
/gitHubToken and useLoggedInUser cannot be used with RuntimeConnection.forUri/
769+
);
766770
});
767771
});
768772

nodejs/test/e2e/commands.e2e.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ describe("Commands", async () => {
2020
await initSession.disconnect();
2121

2222
const { runtimePort } = client1 as unknown as { runtimePort: number };
23-
const client2 = new CopilotClient({ connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, { connectionToken: tcpConnectionToken }) });
23+
const client2 = new CopilotClient({
24+
connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, {
25+
connectionToken: tcpConnectionToken,
26+
}),
27+
});
2428

2529
afterAll(async () => {
2630
await client2.stop();

nodejs/test/e2e/multi-client.e2e.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ describe("Multi-client broadcast", async () => {
2121
await initSession.disconnect();
2222

2323
const runtimePort = (client1 as unknown as { runtimePort: number }).runtimePort;
24-
let client2 = new CopilotClient({ connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, { connectionToken: tcpConnectionToken }) });
24+
let client2 = new CopilotClient({
25+
connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, {
26+
connectionToken: tcpConnectionToken,
27+
}),
28+
});
2529
const EVENT_TIMEOUT_MS = 30_000;
2630

2731
afterAll(async () => {
@@ -350,7 +354,11 @@ describe("Multi-client broadcast", async () => {
350354
process.removeListener("unhandledRejection", suppressDisposed);
351355

352356
// Recreate client2 for cleanup in afterAll (but don't rejoin the session)
353-
client2 = new CopilotClient({ connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, { connectionToken: tcpConnectionToken }) });
357+
client2 = new CopilotClient({
358+
connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, {
359+
connectionToken: tcpConnectionToken,
360+
}),
361+
});
354362

355363
// Now only stable_tool should be available
356364
const afterResponse = await session1.sendAndWait({

nodejs/test/e2e/pending_work_resume.e2e.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ describe("Pending work resume", async () => {
129129
const server = new CopilotClient({
130130
cwd: workDir,
131131
env,
132-
connection: RuntimeConnection.forTcp({ path: process.env.COPILOT_CLI_PATH, connectionToken: SHARED_TOKEN }),
132+
connection: RuntimeConnection.forTcp({
133+
path: process.env.COPILOT_CLI_PATH,
134+
connectionToken: SHARED_TOKEN,
135+
}),
133136
});
134137
onTestFinished(async () => {
135138
try {

nodejs/test/e2e/session_fs.e2e.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ describe("Session Fs", async () => {
103103

104104
it("should reject setProvider when sessions already exist", async () => {
105105
const tcpConnectionToken = "session-fs-test-token";
106-
const client = new CopilotClient({ // Use TCP so we can connect from a second client
106+
const client = new CopilotClient({
107+
// Use TCP so we can connect from a second client
107108
tcpConnectionToken,
108109
env,
109110
});
@@ -117,7 +118,9 @@ describe("Session Fs", async () => {
117118
const client2 = new CopilotClient({
118119
env,
119120
logLevel: "error",
120-
connection: RuntimeConnection.forUri(`localhost:${port}`, { connectionToken: tcpConnectionToken }),
121+
connection: RuntimeConnection.forUri(`localhost:${port}`, {
122+
connectionToken: tcpConnectionToken,
123+
}),
121124
sessionFs: sessionFsConfig,
122125
});
123126
onTestFinished(() => client2.forceStop());

nodejs/test/e2e/suspend.e2e.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ describe("Suspend RPC", async () => {
6565
const server = new CopilotClient({
6666
cwd: workDir,
6767
env,
68-
connection: RuntimeConnection.forTcp({ path: process.env.COPILOT_CLI_PATH, connectionToken: SHARED_TOKEN }),
68+
connection: RuntimeConnection.forTcp({
69+
path: process.env.COPILOT_CLI_PATH,
70+
connectionToken: SHARED_TOKEN,
71+
}),
6972
});
7073
onTestFinishedForceStop(server);
7174
return server;

nodejs/test/e2e/ui_elicitation.e2e.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ describe("UI Elicitation Multi-Client Capabilities", async () => {
6464
await initSession.disconnect();
6565

6666
const { runtimePort } = client1 as unknown as { runtimePort: number };
67-
const client2 = new CopilotClient({ connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, { connectionToken: tcpConnectionToken }) });
67+
const client2 = new CopilotClient({
68+
connection: RuntimeConnection.forUri(`localhost:${runtimePort}`, {
69+
connectionToken: tcpConnectionToken,
70+
}),
71+
});
6872

6973
afterAll(async () => {
7074
await client2.stop();

0 commit comments

Comments
 (0)