Skip to content

Commit d1d733c

Browse files
Remove autoRestart feature across all SDKs
The autoRestart option never worked correctly. This removes it from: - Node.js: types, client options, reconnect logic - Python: types, client options - Go: types, client options, struct field - .NET: types, clone copy, tests - Docs: setup, troubleshooting, READMEs - Agent config: docs-maintenance validation lists Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0dd6bfb commit d1d733c

15 files changed

Lines changed: 12 additions & 65 deletions

File tree

.github/agents/docs-maintenance.agent.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ Every major SDK feature should be documented. Core features include:
122122
- Client initialization and configuration
123123
- Connection modes (stdio vs TCP)
124124
- Authentication options
125-
- Auto-start and auto-restart behavior
126125

127126
**Session Management:**
128127
- Creating sessions
@@ -342,7 +341,7 @@ cat nodejs/src/types.ts | grep -A 10 "export interface ExportSessionOptions"
342341
```
343342

344343
**Must match:**
345-
- `CopilotClient` constructor options: `cliPath`, `cliUrl`, `useStdio`, `port`, `logLevel`, `autoStart`, `autoRestart`, `env`, `githubToken`, `useLoggedInUser`
344+
- `CopilotClient` constructor options: `cliPath`, `cliUrl`, `useStdio`, `port`, `logLevel`, `autoStart`, `env`, `githubToken`, `useLoggedInUser`
346345
- `createSession()` config: `model`, `tools`, `hooks`, `systemMessage`, `mcpServers`, `availableTools`, `excludedTools`, `streaming`, `reasoningEffort`, `provider`, `infiniteSessions`, `customAgents`, `workingDirectory`
347346
- `CopilotSession` methods: `send()`, `sendAndWait()`, `getMessages()`, `disconnect()`, `abort()`, `on()`, `once()`, `off()`
348347
- Hook names: `onPreToolUse`, `onPostToolUse`, `onUserPromptSubmitted`, `onSessionStart`, `onSessionEnd`, `onErrorOccurred`
@@ -360,7 +359,7 @@ cat python/copilot/types.py | grep -A 15 "class SessionHooks"
360359
```
361360

362361
**Must match (snake_case):**
363-
- `CopilotClient` options: `cli_path`, `cli_url`, `use_stdio`, `port`, `log_level`, `auto_start`, `auto_restart`, `env`, `github_token`, `use_logged_in_user`
362+
- `CopilotClient` options: `cli_path`, `cli_url`, `use_stdio`, `port`, `log_level`, `auto_start`, `env`, `github_token`, `use_logged_in_user`
364363
- `create_session()` config keys: `model`, `tools`, `hooks`, `system_message`, `mcp_servers`, `available_tools`, `excluded_tools`, `streaming`, `reasoning_effort`, `provider`, `infinite_sessions`, `custom_agents`, `working_directory`
365364
- `CopilotSession` methods: `send()`, `send_and_wait()`, `get_messages()`, `disconnect()`, `abort()`, `export_session()`
366365
- Hook names: `on_pre_tool_use`, `on_post_tool_use`, `on_user_prompt_submitted`, `on_session_start`, `on_session_end`, `on_error_occurred`
@@ -378,7 +377,7 @@ cat go/types.go | grep -A 15 "type SessionHooks struct"
378377
```
379378

380379
**Must match (PascalCase for exported):**
381-
- `ClientOptions` fields: `CLIPath`, `CLIUrl`, `UseStdio`, `Port`, `LogLevel`, `AutoStart`, `AutoRestart`, `Env`, `GithubToken`, `UseLoggedInUser`
380+
- `ClientOptions` fields: `CLIPath`, `CLIUrl`, `UseStdio`, `Port`, `LogLevel`, `AutoStart`, `Env`, `GithubToken`, `UseLoggedInUser`
382381
- `SessionConfig` fields: `Model`, `Tools`, `Hooks`, `SystemMessage`, `MCPServers`, `AvailableTools`, `ExcludedTools`, `Streaming`, `ReasoningEffort`, `Provider`, `InfiniteSessions`, `CustomAgents`, `WorkingDirectory`
383382
- `Session` methods: `Send()`, `SendAndWait()`, `GetMessages()`, `Disconnect()`, `Abort()`, `ExportSession()`
384383
- Hook fields: `OnPreToolUse`, `OnPostToolUse`, `OnUserPromptSubmitted`, `OnSessionStart`, `OnSessionEnd`, `OnErrorOccurred`
@@ -396,7 +395,7 @@ cat dotnet/src/Types.cs | grep -A 15 "public class SessionHooks"
396395
```
397396

398397
**Must match (PascalCase):**
399-
- `CopilotClientOptions` properties: `CliPath`, `CliUrl`, `UseStdio`, `Port`, `LogLevel`, `AutoStart`, `AutoRestart`, `Environment`, `GithubToken`, `UseLoggedInUser`
398+
- `CopilotClientOptions` properties: `CliPath`, `CliUrl`, `UseStdio`, `Port`, `LogLevel`, `AutoStart`, `Environment`, `GithubToken`, `UseLoggedInUser`
400399
- `SessionConfig` properties: `Model`, `Tools`, `Hooks`, `SystemMessage`, `McpServers`, `AvailableTools`, `ExcludedTools`, `Streaming`, `ReasoningEffort`, `Provider`, `InfiniteSessions`, `CustomAgents`, `WorkingDirectory`
401400
- `CopilotSession` methods: `SendAsync()`, `SendAndWaitAsync()`, `GetMessagesAsync()`, `DisposeAsync()`, `AbortAsync()`, `ExportSessionAsync()`
402401
- Hook properties: `OnPreToolUse`, `OnPostToolUse`, `OnUserPromptSubmitted`, `OnSessionStart`, `OnSessionEnd`, `OnErrorOccurred`

docs/setup/local-cli.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ const client = new CopilotClient({
171171

172172
// Set working directory
173173
cwd: "/path/to/project",
174-
175-
// Auto-restart CLI if it crashes (default: true)
176-
autoRestart: true,
177174
});
178175
```
179176

docs/troubleshooting/debugging.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,6 @@ var client = new CopilotClient(new CopilotClientOptions
297297
copilot --server --stdio
298298
```
299299

300-
2. Enable auto-restart (enabled by default):
301-
```typescript
302-
const client = new CopilotClient({
303-
autoRestart: true,
304-
});
305-
```
306-
307300
3. Check for port conflicts if using TCP mode:
308301
```typescript
309302
const client = new CopilotClient({

dotnet/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ new CopilotClient(CopilotClientOptions? options = null)
7373
- `UseStdio` - Use stdio transport instead of TCP (default: true)
7474
- `LogLevel` - Log level (default: "info")
7575
- `AutoStart` - Auto-start server (default: true)
76-
- `AutoRestart` - Auto-restart on crash (default: true)
7776
- `Cwd` - Working directory for the CLI process
7877
- `Environment` - Environment variables to pass to the CLI process
7978
- `Logger` - `ILogger` instance for SDK logging

dotnet/src/Types.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ protected CopilotClientOptions(CopilotClientOptions? other)
5050
{
5151
if (other is null) return;
5252

53-
AutoRestart = other.AutoRestart;
5453
AutoStart = other.AutoStart;
5554
CliArgs = (string[]?)other.CliArgs?.Clone();
5655
CliPath = other.CliPath;
@@ -99,10 +98,6 @@ protected CopilotClientOptions(CopilotClientOptions? other)
9998
/// </summary>
10099
public bool AutoStart { get; set; } = true;
101100
/// <summary>
102-
/// Whether to automatically restart the CLI server if it exits unexpectedly.
103-
/// </summary>
104-
public bool AutoRestart { get; set; } = true;
105-
/// <summary>
106101
/// Environment variables to pass to the CLI process.
107102
/// </summary>
108103
public IReadOnlyDictionary<string, string>? Environment { get; set; }

dotnet/test/CloneTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties()
2222
CliUrl = "http://localhost:8080",
2323
LogLevel = "debug",
2424
AutoStart = false,
25-
AutoRestart = false,
25+
2626
Environment = new Dictionary<string, string> { ["KEY"] = "value" },
2727
GitHubToken = "ghp_test",
2828
UseLoggedInUser = false,
@@ -38,7 +38,7 @@ public void CopilotClientOptions_Clone_CopiesAllProperties()
3838
Assert.Equal(original.CliUrl, clone.CliUrl);
3939
Assert.Equal(original.LogLevel, clone.LogLevel);
4040
Assert.Equal(original.AutoStart, clone.AutoStart);
41-
Assert.Equal(original.AutoRestart, clone.AutoRestart);
41+
4242
Assert.Equal(original.Environment, clone.Environment);
4343
Assert.Equal(original.GitHubToken, clone.GitHubToken);
4444
Assert.Equal(original.UseLoggedInUser, clone.UseLoggedInUser);

go/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec
138138
- `UseStdio` (bool): Use stdio transport instead of TCP (default: true)
139139
- `LogLevel` (string): Log level (default: "info")
140140
- `AutoStart` (\*bool): Auto-start server on first use (default: true). Use `Bool(false)` to disable.
141-
- `AutoRestart` (\*bool): Auto-restart on crash (default: true). Use `Bool(false)` to disable.
142141
- `Env` ([]string): Environment variables for CLI process (default: inherits from current process)
143142
- `GitHubToken` (string): GitHub token for authentication. When provided, takes priority over other auth methods.
144143
- `UseLoggedInUser` (\*bool): Whether to use logged-in user for authentication (default: true, but false when `GitHubToken` is provided). Cannot be used with `CLIUrl`.
@@ -174,7 +173,7 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec
174173

175174
### Helper Functions
176175

177-
- `Bool(v bool) *bool` - Helper to create bool pointers for `AutoStart`/`AutoRestart` options
176+
- `Bool(v bool) *bool` - Helper to create bool pointers for `AutoStart` option
178177

179178
## Image Support
180179

go/client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type Client struct {
8383
conn net.Conn // stores net.Conn for external TCP connections
8484
useStdio bool // resolved value from options
8585
autoStart bool // resolved value from options
86-
autoRestart bool // resolved value from options
86+
8787
modelsCache []ModelInfo
8888
modelsCacheMux sync.Mutex
8989
lifecycleHandlers []SessionLifecycleHandler
@@ -132,7 +132,6 @@ func NewClient(options *ClientOptions) *Client {
132132
isExternalServer: false,
133133
useStdio: true,
134134
autoStart: true, // default
135-
autoRestart: true, // default
136135
}
137136

138137
if options != nil {
@@ -182,9 +181,6 @@ func NewClient(options *ClientOptions) *Client {
182181
if options.AutoStart != nil {
183182
client.autoStart = *options.AutoStart
184183
}
185-
if options.AutoRestart != nil {
186-
client.autoRestart = *options.AutoRestart
187-
}
188184
if options.GitHubToken != "" {
189185
opts.GitHubToken = options.GitHubToken
190186
}

go/types.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ 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-
// AutoRestart automatically restarts the CLI server if it crashes (default: true).
42-
// Use Bool(false) to disable.
43-
AutoRestart *bool
4441
// Env is the environment variables for the CLI process (default: inherits from current process).
4542
// Each entry is of the form "key=value".
4643
// If Env is nil, the new process uses the current process's environment.
@@ -65,7 +62,7 @@ type ClientOptions struct {
6562
}
6663

6764
// Bool returns a pointer to the given bool value.
68-
// Use for setting AutoStart or AutoRestart: AutoStart: Bool(false)
65+
// Use for setting AutoStart: AutoStart: Bool(false)
6966
func Bool(v bool) *bool {
7067
return &v
7168
}

nodejs/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ new CopilotClient(options?: CopilotClientOptions)
8282
- `useStdio?: boolean` - Use stdio transport instead of TCP (default: true)
8383
- `logLevel?: string` - Log level (default: "info")
8484
- `autoStart?: boolean` - Auto-start server (default: true)
85-
- `autoRestart?: boolean` - Auto-restart on crash (default: true)
8685
- `githubToken?: string` - GitHub token for authentication. When provided, takes priority over other auth methods.
8786
- `useLoggedInUser?: boolean` - Whether to use logged-in user for authentication (default: true, but false when `githubToken` is provided). Cannot be used with `cliUrl`.
8887

0 commit comments

Comments
 (0)