Skip to content

Commit 429870a

Browse files
jmoseleyCopilot
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 e1716de commit 429870a

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
@@ -592,16 +592,6 @@ func (s *Session) dispatchShellExit(notification ShellExitNotification) {
592592
}
593593
}
594594

595-
// trackShellProcess tracks a shell process ID so notifications are routed to this session.
596-
func (s *Session) trackShellProcess(processID string) {
597-
s.trackedProcessMux.Lock()
598-
s.trackedProcessIDs[processID] = struct{}{}
599-
s.trackedProcessMux.Unlock()
600-
if s.registerShellProc != nil {
601-
s.registerShellProc(processID, s)
602-
}
603-
}
604-
605595
// untrackShellProcess stops tracking a shell process ID.
606596
func (s *Session) untrackShellProcess(processID string) {
607597
s.trackedProcessMux.Lock()

nodejs/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ export class CopilotClient {
561561
const session = new CopilotSession(sessionId, this.connection!);
562562
session._setShellProcessCallbacks(
563563
(processId, session) => this.shellProcessMap.set(processId, session),
564-
(processId) => this.shellProcessMap.delete(processId),
564+
(processId) => this.shellProcessMap.delete(processId)
565565
);
566566
session.registerTools(config.tools);
567567
session.registerPermissionHandler(config.onPermissionRequest);
@@ -664,7 +664,7 @@ export class CopilotClient {
664664
const session = new CopilotSession(sessionId, this.connection!);
665665
session._setShellProcessCallbacks(
666666
(processId, session) => this.shellProcessMap.set(processId, session),
667-
(processId) => this.shellProcessMap.delete(processId),
667+
(processId) => this.shellProcessMap.delete(processId)
668668
);
669669
session.registerTools(config.tools);
670670
session.registerPermissionHandler(config.onPermissionRequest);

nodejs/src/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export class CopilotSession {
418418
*/
419419
_setShellProcessCallbacks(
420420
register: (processId: string, session: CopilotSession) => void,
421-
unregister: (processId: string) => void,
421+
unregister: (processId: string) => void
422422
): void {
423423
this._registerShellProcess = register;
424424
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

@@ -347,7 +349,7 @@ def _untrack_shell_process(self, process_id: str) -> None:
347349

348350
def _set_shell_process_callbacks(
349351
self,
350-
register: Callable[[str, "CopilotSession"], None],
352+
register: Callable[[str, CopilotSession], None],
351353
unregister: Callable[[str], None],
352354
) -> None:
353355
"""Set the registration callbacks for shell process tracking.
@@ -807,7 +809,7 @@ async def destroy(self) -> None:
807809
)
808810
await self.disconnect()
809811

810-
async def __aenter__(self) -> "CopilotSession":
812+
async def __aenter__(self) -> CopilotSession:
811813
"""Enable use as an async context manager."""
812814
return self
813815

0 commit comments

Comments
 (0)