Skip to content

Commit 94318d5

Browse files
jmoseleyCopilot
authored andcommitted
Fix CI: prettier formatting, ruff lint, unused Go function
- Run prettier on Node.js files (client.ts, session.ts, test) - Add 'from __future__ import annotations' to Python session.py and remove quoted forward references (ruff UP037) - Remove unused trackShellProcess function in Go (golangci-lint) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fb38196 commit 94318d5

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

go/session.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -619,16 +619,6 @@ func (s *Session) dispatchShellExit(notification ShellExitNotification) {
619619
}
620620
}
621621

622-
// trackShellProcess tracks a shell process ID so notifications are routed to this session.
623-
func (s *Session) trackShellProcess(processID string) {
624-
s.trackedProcessMux.Lock()
625-
s.trackedProcessIDs[processID] = struct{}{}
626-
s.trackedProcessMux.Unlock()
627-
if s.registerShellProc != nil {
628-
s.registerShellProc(processID, s)
629-
}
630-
}
631-
632622
// untrackShellProcess stops tracking a shell process ID.
633623
func (s *Session) untrackShellProcess(processID string) {
634624
s.trackedProcessMux.Lock()

nodejs/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ export class CopilotClient {
562562
const session = new CopilotSession(sessionId, this.connection!);
563563
session._setShellProcessCallbacks(
564564
(processId, session) => this.shellProcessMap.set(processId, session),
565-
(processId) => this.shellProcessMap.delete(processId),
565+
(processId) => this.shellProcessMap.delete(processId)
566566
);
567567
session.registerTools(config.tools);
568568
session.registerPermissionHandler(config.onPermissionRequest);
@@ -666,7 +666,7 @@ export class CopilotClient {
666666
const session = new CopilotSession(sessionId, this.connection!);
667667
session._setShellProcessCallbacks(
668668
(processId, session) => this.shellProcessMap.set(processId, session),
669-
(processId) => this.shellProcessMap.delete(processId),
669+
(processId) => this.shellProcessMap.delete(processId)
670670
);
671671
session.registerTools(config.tools);
672672
session.registerPermissionHandler(config.onPermissionRequest);

nodejs/src/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export class CopilotSession {
421421
*/
422422
_setShellProcessCallbacks(
423423
register: (processId: string, session: CopilotSession) => void,
424-
unregister: (processId: string) => void,
424+
unregister: (processId: string) => void
425425
): void {
426426
this._registerShellProcess = register;
427427
this._unregisterShellProcess = unregister;

nodejs/test/session-shell.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe("CopilotSession shell notifications", () => {
136136

137137
session._setShellProcessCallbacks(
138138
(processId, s) => registered.set(processId, s),
139-
(processId) => registered.delete(processId),
139+
(processId) => registered.delete(processId)
140140
);
141141

142142
session._trackShellProcess("proc-1");

python/copilot/session.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
conversation sessions with the Copilot CLI.
66
"""
77

8+
from __future__ import annotations
9+
810
import asyncio
911
import inspect
1012
import threading
@@ -106,7 +108,7 @@ def __init__(self, session_id: str, client: Any, workspace_path: str | None = No
106108
self._shell_exit_handlers_lock = threading.Lock()
107109
self._tracked_process_ids: set[str] = set()
108110
self._tracked_process_ids_lock = threading.Lock()
109-
self._register_shell_process: Callable[[str, "CopilotSession"], None] | None = None
111+
self._register_shell_process: Callable[[str, CopilotSession], None] | None = None
110112
self._unregister_shell_process_fn: Callable[[str], None] | None = None
111113
self._rpc: SessionRpc | None = None
112114

@@ -348,7 +350,7 @@ def _untrack_shell_process(self, process_id: str) -> None:
348350

349351
def _set_shell_process_callbacks(
350352
self,
351-
register: Callable[[str, "CopilotSession"], None],
353+
register: Callable[[str, CopilotSession], None],
352354
unregister: Callable[[str], None],
353355
) -> None:
354356
"""Set the registration callbacks for shell process tracking.
@@ -810,7 +812,7 @@ async def destroy(self) -> None:
810812
)
811813
await self.disconnect()
812814

813-
async def __aenter__(self) -> "CopilotSession":
815+
async def __aenter__(self) -> CopilotSession:
814816
"""Enable use as an async context manager."""
815817
return self
816818

0 commit comments

Comments
 (0)