Skip to content

Commit e060f62

Browse files
Re-add autoRestart as deprecated no-op to avoid source-breaking change
Mark the option as obsolete/deprecated in Go, .NET, and TypeScript so existing consumers continue to compile without changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 38566a9 commit e060f62

5 files changed

Lines changed: 18 additions & 3 deletions

File tree

dotnet/src/Types.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ protected CopilotClientOptions(CopilotClientOptions? other)
5151
if (other is null) return;
5252

5353
AutoStart = other.AutoStart;
54+
#pragma warning disable CS0618 // Obsolete member
55+
AutoRestart = other.AutoRestart;
56+
#pragma warning restore CS0618
5457
CliArgs = (string[]?)other.CliArgs?.Clone();
5558
CliPath = other.CliPath;
5659
CliUrl = other.CliUrl;
@@ -98,6 +101,11 @@ protected CopilotClientOptions(CopilotClientOptions? other)
98101
/// </summary>
99102
public bool AutoStart { get; set; } = true;
100103
/// <summary>
104+
/// Obsolete. This option has no effect.
105+
/// </summary>
106+
[Obsolete("AutoRestart has no effect and will be removed in a future release.")]
107+
public bool AutoRestart { get; set; }
108+
/// <summary>
101109
/// Environment variables to pass to the CLI process.
102110
/// </summary>
103111
public IReadOnlyDictionary<string, string>? Environment { get; set; }

go/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type ClientOptions struct {
3838
// AutoStart automatically starts the CLI server on first use (default: true).
3939
// Use Bool(false) to disable.
4040
AutoStart *bool
41+
// Deprecated: AutoRestart has no effect and will be removed in a future release.
42+
AutoRestart *bool
4143
// Env is the environment variables for the CLI process (default: inherits from current process).
4244
// Each entry is of the form "key=value".
4345
// If Env is nil, the new process uses the current process's environment.

nodejs/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export class CopilotClient {
243243
cliUrl: options.cliUrl,
244244
logLevel: options.logLevel || "debug",
245245
autoStart: options.autoStart ?? true,
246+
autoRestart: false,
246247

247248
env: options.env ?? process.env,
248249
githubToken: options.githubToken,
@@ -1640,5 +1641,4 @@ export class CopilotClient {
16401641
"resultType" in value
16411642
);
16421643
}
1643-
16441644
}

nodejs/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export interface CopilotClientOptions {
7171
*/
7272
autoStart?: boolean;
7373

74+
/**
75+
* @deprecated This option has no effect and will be removed in a future release.
76+
*/
77+
autoRestart?: boolean;
78+
7479
/**
7580
* Environment variables to pass to the CLI process. If not set, inherits process.env.
7681
*/

python/copilot/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ async def _connect_via_stdio(self) -> None:
14051405

14061406
# Create JSON-RPC client with the process
14071407
self._client = JsonRpcClient(self._process)
1408-
self._client.on_close = lambda: setattr(self, '_state', 'disconnected')
1408+
self._client.on_close = lambda: setattr(self, "_state", "disconnected")
14091409
self._rpc = ServerRpc(self._client)
14101410

14111411
# Set up notification handler for session events
@@ -1493,7 +1493,7 @@ def wait(self, timeout=None):
14931493

14941494
self._process = SocketWrapper(sock_file, sock) # type: ignore
14951495
self._client = JsonRpcClient(self._process)
1496-
self._client.on_close = lambda: setattr(self, '_state', 'disconnected')
1496+
self._client.on_close = lambda: setattr(self, "_state", "disconnected")
14971497
self._rpc = ServerRpc(self._client)
14981498

14991499
# Set up notification handler for session events

0 commit comments

Comments
 (0)