File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ function getBundledCliPath(): string {
199199 * ```
200200 */
201201export class CopilotClient {
202+ private cliStartTimeout : ReturnType < typeof setTimeout > | null = null ;
202203 private cliProcess : ChildProcess | null = null ;
203204 private connection : MessageConnection | null = null ;
204205 private socket : Socket | null = null ;
@@ -540,6 +541,10 @@ export class CopilotClient {
540541 }
541542 this . cliProcess = null ;
542543 }
544+ if ( this . cliStartTimeout ) {
545+ clearTimeout ( this . cliStartTimeout ) ;
546+ this . cliStartTimeout = null ;
547+ }
543548
544549 this . state = "disconnected" ;
545550 this . actualPort = null ;
@@ -613,6 +618,11 @@ export class CopilotClient {
613618 this . cliProcess = null ;
614619 }
615620
621+ if ( this . cliStartTimeout ) {
622+ clearTimeout ( this . cliStartTimeout ) ;
623+ this . cliStartTimeout = null ;
624+ }
625+
616626 this . state = "disconnected" ;
617627 this . actualPort = null ;
618628 this . stderrBuffer = "" ;
@@ -1522,7 +1532,7 @@ export class CopilotClient {
15221532 } ) ;
15231533
15241534 // Timeout after 10 seconds
1525- setTimeout ( ( ) => {
1535+ this . cliStartTimeout = setTimeout ( ( ) => {
15261536 if ( ! resolved ) {
15271537 resolved = true ;
15281538 reject ( new Error ( "Timeout waiting for CLI server to start" ) ) ;
You can’t perform that action at this time.
0 commit comments