You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document EnableSessionStore and one-shot session guidance
Add EnableSessionStore to SessionConfig documentation and a new
One-shot / Hosted Environments section across all language READMEs.
Explains when to disable infinite sessions and the session store in
ephemeral containers to avoid unnecessary SQLite persistence.
Related to #1814
Copy file name to clipboardExpand all lines: dotnet/README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ Create a new conversation session.
125
125
-`Provider` - Custom API provider configuration (BYOK)
126
126
-`Streaming` - Enable streaming of response chunks (default: false)
127
127
-`InfiniteSessions` - Configure automatic context compaction (see below)
128
+
-`EnableSessionStore` - Enables the cross-session store for search and retrieval across sessions. When unset in `CopilotCli` mode, the runtime default applies (enabled). In `Empty` mode, defaults to disabled. See [One-shot / Hosted Environments](#one-shot--hosted-environments).
128
129
-`OnPermissionRequest` - Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. Use `PermissionHandler.ApproveAll` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
129
130
-`OnUserInputRequest` - Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
130
131
-`Hooks` - Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
@@ -416,6 +417,27 @@ When enabled, sessions emit compaction events:
416
417
-`SessionCompactionStartEvent` - Background compaction started
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
423
+
424
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
425
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default in `CopilotCli` mode when `EnableSessionStore` is unset)
426
+
427
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
In `CopilotClientMode.Empty`, the SDK already defaults `EnableSessionStore` to `false`; in the default `CopilotCli` mode, you must set it explicitly.
440
+
419
441
## Memory
420
442
421
443
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `CreateSessionAsync` and `ResumeSessionAsync`.
-`EnableSessionStore` (\*bool): Enables the cross-session store for search and retrieval across sessions. When unset in `ModeCopilotCli`, the runtime default applies (enabled). In `ModeEmpty`, defaults to disabled. See [One-shot / Hosted Environments](#one-shot--hosted-environments).
172
173
-`OnPermissionRequest` (PermissionHandlerFunc): Optional handler called before each tool execution to approve or deny it. When nil, permission requests are emitted as events and left pending for manual resolution. Use `copilot.PermissionHandler.ApproveAll` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
173
174
-`OnUserInputRequest` (UserInputHandler): Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
174
175
-`Hooks` (\*SessionHooks): Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
@@ -507,6 +508,29 @@ When enabled, sessions emit compaction events:
507
508
-`session.compaction_start` - Background compaction started
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
514
+
515
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
516
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default in `ModeCopilotCli` when `EnableSessionStore` is unset)
517
+
518
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
138
+
139
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
140
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default in `CopilotClientMode.COPILOT_CLI` when `enableSessionStore` is unset)
141
+
142
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
In `CopilotClientMode.EMPTY`, the SDK already defaults `enableSessionStore` to `false`; in the default `CopilotClientMode.COPILOT_CLI` mode, you must set it explicitly.
158
+
135
159
## Memory
136
160
137
161
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `createSession` and `resumeSession`.
Copy file name to clipboardExpand all lines: nodejs/README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,7 @@ Create a new conversation session.
127
127
-`tools?: Tool[]` - Custom tools exposed to the CLI. Tools without `handler` are declaration-only and must be resolved via pending tool-call RPCs.
128
128
-`systemMessage?: SystemMessageConfig` - System message customization (see below)
129
129
-`infiniteSessions?: InfiniteSessionConfig` - Configure automatic context compaction (see below)
130
+
-`enableSessionStore?: boolean` - Enables the cross-session store for search and retrieval across sessions. When unset in `"copilot-cli"` mode, the runtime default applies (enabled). In `"empty"` mode, defaults to disabled. See [One-shot / Hosted Environments](#one-shot--hosted-environments).
130
131
-`provider?: ProviderConfig` - Custom API provider configuration (BYOK - Bring Your Own Key). See [Custom Providers](#custom-providers) section.
131
132
-`onPermissionRequest?: PermissionHandler` - Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. Use `approveAll` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
132
133
-`onUserInputRequest?: UserInputHandler` - Handler for user input requests from the agent. Enables the `ask_user` tool. See [User Input Requests](#user-input-requests) section.
@@ -680,6 +681,26 @@ When enabled, sessions emit compaction events:
680
681
-`session.compaction_start` - Background compaction started
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
687
+
688
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
689
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default in `"copilot-cli"` mode when `enableSessionStore` is unset)
690
+
691
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
692
+
693
+
```typescript
694
+
const session =awaitclient.createSession({
695
+
model: "gpt-5",
696
+
enableSessionStore: false,
697
+
infiniteSessions: { enabled: false },
698
+
onPermissionRequest: approveAll,
699
+
});
700
+
```
701
+
702
+
In `"empty"` mode, the SDK already defaults `enableSessionStore` to `false`; in the default `"copilot-cli"` mode, you must set it explicitly.
703
+
683
704
### Memory
684
705
685
706
Sessions can opt in to the memory feature, which lets the agent persist and recall
-`enable_session_store` (bool): Enables the cross-session store for search and retrieval across sessions. When unset in `"copilot-cli"` mode, the runtime default applies (enabled). In `"empty"` mode, defaults to disabled. See [One-shot / Hosted Environments](#one-shot--hosted-environments).
220
221
-`on_permission_request` (callable): Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. Use `PermissionHandler.approve_all` to allow everything, or provide a custom function for fine-grained control. See [Permission Handling](#permission-handling) section.
221
222
-`on_user_input_request` (callable): Handler for user input requests from the agent (enables ask_user tool). See [User Input Requests](#user-input-requests) section.
222
223
-`hooks` (SessionHooks): Hook handlers for session lifecycle events. See [Session Hooks](#session-hooks) section.
@@ -502,6 +503,27 @@ When enabled, sessions emit compaction events:
502
503
-`session.compaction_start` - Background compaction started
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
509
+
510
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
511
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default in `"copilot-cli"` mode when `enable_session_store` is unset)
512
+
513
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
In `"empty"` mode, the SDK already defaults `enable_session_store` to `False`; in the default `"copilot-cli"` mode, you must set it explicitly.
526
+
505
527
## Memory
506
528
507
529
Sessions can opt into persistent memory, allowing the agent to read and write memory across turns. Memory is configured per session and applies to both `create_session` and `resume_session`.
The CLI emits `session.compaction_start` / `session.compaction_complete` events around each compaction. The session id remains stable across compactions; resume with `Client::resume_session` to pick up a prior conversation. Workspace state lives under `~/.copilot/session-state/{sessionId}` by default — override with `workspace_path` to relocate.
573
573
574
+
`enable_session_store` on `SessionConfig` controls the cross-session store for search and retrieval across sessions. When unset in the default client mode, the runtime default applies (enabled). In empty mode, the SDK defaults it to disabled.
575
+
576
+
### One-shot / Hosted Environments
577
+
578
+
When running the SDK in ephemeral containers or other one-shot environments (one request per container), the default session configuration enables SQLite-backed persistence features that you typically do not need:
579
+
580
+
-**Infinite sessions** — background compaction and workspace persistence (enabled by default)
581
+
-**Session store** — cross-session search and retrieval via a shared SQLite store (enabled by default when `enable_session_store` is unset)
582
+
583
+
In restricted or short-lived environments, explicitly disable both to avoid unnecessary disk I/O and transient SQLite lock errors:
584
+
585
+
```rust,ignore
586
+
let config = SessionConfig::default()
587
+
.with_enable_session_store(false)
588
+
.with_infinite_sessions(InfiniteSessionConfig {
589
+
enabled: Some(false),
590
+
..Default::default()
591
+
});
592
+
```
593
+
594
+
In empty mode, the SDK already defaults `enable_session_store` to `false`; in the default client mode, you must set it explicitly.
595
+
574
596
### Memory
575
597
576
598
Configure the runtime memory feature for a session:
0 commit comments