Skip to content

Commit dbfda40

Browse files
feat: add mcpOAuthTokenStorage support across all SDKs (#1326)
* feat: add mcpOAuthTokenStorage support across all SDKs Add the mcpOAuthTokenStorage protocol property to session creation and resume flows in all five language SDKs (Node.js, Python, Go, .NET, Rust). When set to "in-memory", the runtime uses an in-memory MCP OAuth token store instead of the OS keychain. The SDK defaults to "in-memory" for safe multitenant behavior. - Node.js: Add to SessionConfig interface and ResumeSessionConfig Pick type - Python: Add to both TypedDicts and client methods with docstrings - Go: Add to config structs, wire request structs, and client wiring - .NET: Add McpOAuthTokenStorageMode enum with JsonStringEnumConverter, update config classes, copy constructors, wire records, and serialization context - Rust: Add field, builder methods, Default/new impls, and Debug impls Tests: - Rust: Assert defaults and builder composition in existing type tests - .NET: Add property to SessionConfig_Clone_CopiesAllProperties test - Go: Add wire serialization tests for both request types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(go): rename McpOAuthTokenStorage to MCPOAuthTokenStorage Follow Go naming convention for initialisms (consistent with MCPServers). Also fixes JSON tags that were accidentally changed from camelCase wire format during the rename. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(go): add error handling in MCPOAuthTokenStorage omit subtests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(nodejs): add mcpOAuthTokenStorage default and forwarding tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(python): add mcp_oauth_token_storage default and forwarding tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(python): use current CopilotClient constructor in mcpOAuthTokenStorage tests Replace SubprocessConfig positional arg (removed in main) with keyword-only connection=RuntimeConnection.for_stdio(path=CLI_PATH), matching the pattern used by all other tests in the file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(java): add mcpOAuthTokenStorage support Add mcpOAuthTokenStorage field to SessionConfig, ResumeSessionConfig, CreateSessionRequest, and ResumeSessionRequest. The SessionRequestBuilder defaults to "in-memory" for safe multitenant behavior, consistent with all other SDK implementations. Includes 6 unit tests covering default and explicit value forwarding for both create and resume paths, plus null config handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix MCP OAuth test regressions Update the Python MCP OAuth request interception tests to forward keyword arguments introduced by the merged create_session path, and add focused .NET clone tests so McpOAuth coverage can be validated directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Move mcpOAuthTokenStorage default to empty (multitenant) mode only Previously, all SDKs unconditionally defaulted mcpOAuthTokenStorage to "in-memory". With the client mode system from PR #1428, the safe multitenant default now only applies in "empty" mode. In "copilot-cli" mode, the property is not sent, letting the runtime default to "persistent" (backward compatible). Changes across all 6 SDKs: - Node.js: configDefaultsForMode() sets default for empty mode only - Python: _mcp_oauth_token_storage_default() helper checks mode - Go: applyConfigDefaultsForMode/applyResumeDefaultsForMode set default - .NET: ApplyConfigDefaultsForMode() uses ??= for empty mode - Rust: Default impls return None; session.rs applies for empty mode - Java: CopilotClient applies default in empty mode blocks Tests updated to verify mode-specific behavior in all SDKs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix stale doc comments for mcp_oauth_token_storage in Rust The doc comments incorrectly stated the default came from SessionConfig::default(). Updated to reflect that the in-memory default is applied at the client level when ClientMode::Empty is active. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix formatting in Node.js and Python test files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Python type annotation for _mcp_oauth_token_storage_default Use Literal type instead of str to match the parameter type in client.py, fixing the red-knot invalid-assignment diagnostic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add base_directory to Python empty mode tests Empty mode requires base_directory to avoid falling back to ~/.copilot. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6ffb9e1 commit dbfda40

24 files changed

Lines changed: 654 additions & 3 deletions

dotnet/src/Client.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ private void ApplyConfigDefaultsForMode(SessionConfigBase config)
637637
if (_options.Mode == CopilotClientMode.Empty)
638638
{
639639
config.EnableSessionTelemetry ??= false;
640+
config.McpOAuthTokenStorage ??= McpOAuthTokenStorageMode.InMemory;
640641
}
641642
}
642643

@@ -868,6 +869,7 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig config, Cance
868869
config.Streaming is true ? true : null,
869870
config.IncludeSubAgentStreamingEvents,
870871
config.McpServers,
872+
config.McpOAuthTokenStorage,
871873
"direct",
872874
config.CustomAgents,
873875
config.DefaultAgent,
@@ -1055,6 +1057,7 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
10551057
config.Streaming is true ? true : null,
10561058
config.IncludeSubAgentStreamingEvents,
10571059
config.McpServers,
1060+
config.McpOAuthTokenStorage,
10581061
"direct",
10591062
config.CustomAgents,
10601063
config.DefaultAgent,
@@ -2169,6 +2172,7 @@ internal record CreateSessionRequest(
21692172
bool? Streaming,
21702173
bool? IncludeSubAgentStreamingEvents,
21712174
IDictionary<string, McpServerConfig>? McpServers,
2175+
McpOAuthTokenStorageMode? McpOAuthTokenStorage,
21722176
string? EnvValueMode,
21732177
IList<CustomAgentConfig>? CustomAgents,
21742178
DefaultAgentConfig? DefaultAgent,
@@ -2247,6 +2251,7 @@ internal record ResumeSessionRequest(
22472251
bool? Streaming,
22482252
bool? IncludeSubAgentStreamingEvents,
22492253
IDictionary<string, McpServerConfig>? McpServers,
2254+
McpOAuthTokenStorageMode? McpOAuthTokenStorage,
22502255
string? EnvValueMode,
22512256
IList<CustomAgentConfig>? CustomAgents,
22522257
DefaultAgentConfig? DefaultAgent,
@@ -2343,6 +2348,7 @@ internal record HooksInvokeResponse(
23432348
[JsonSerializable(typeof(ListSessionsResponse))]
23442349
[JsonSerializable(typeof(GetSessionMetadataRequest))]
23452350
[JsonSerializable(typeof(GetSessionMetadataResponse))]
2351+
[JsonSerializable(typeof(McpOAuthTokenStorageMode))]
23462352
[JsonSerializable(typeof(ModelCapabilitiesOverride))]
23472353
[JsonSerializable(typeof(ProviderConfig))]
23482354
[JsonSerializable(typeof(ResumeSessionRequest))]

dotnet/src/Types.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,21 @@ public enum McpHttpServerConfigOauthGrantType
20812081
ClientCredentials
20822082
}
20832083

2084+
/// <summary>
2085+
/// Controls how MCP OAuth tokens are stored for a session.
2086+
/// </summary>
2087+
[JsonConverter(typeof(JsonStringEnumConverter<McpOAuthTokenStorageMode>))]
2088+
public enum McpOAuthTokenStorageMode
2089+
{
2090+
/// <summary>Tokens are stored in the OS keychain, shared across sessions.</summary>
2091+
[JsonStringEnumMemberName("persistent")]
2092+
Persistent,
2093+
2094+
/// <summary>Tokens are stored in memory and discarded when the session ends.</summary>
2095+
[JsonStringEnumMemberName("in-memory")]
2096+
InMemory
2097+
}
2098+
20842099
/// <summary>
20852100
/// Abstract base class for MCP server configurations.
20862101
/// </summary>
@@ -2397,6 +2412,7 @@ protected SessionConfigBase(SessionConfigBase? other)
23972412
? new Dictionary<string, McpServerConfig>(dict, dict.Comparer)
23982413
: new Dictionary<string, McpServerConfig>(other.McpServers))
23992414
: null;
2415+
McpOAuthTokenStorage = other.McpOAuthTokenStorage;
24002416
Model = other.Model;
24012417
ModelCapabilities = other.ModelCapabilities;
24022418
OnAutoModeSwitchRequest = other.OnAutoModeSwitchRequest;
@@ -2616,6 +2632,12 @@ protected SessionConfigBase(SessionConfigBase? other)
26162632
/// </summary>
26172633
public IDictionary<string, McpServerConfig>? McpServers { get; set; }
26182634

2635+
/// <summary>
2636+
/// Controls how MCP OAuth tokens are stored for this session.
2637+
/// Default: <see cref="McpOAuthTokenStorageMode.InMemory"/> for safe multitenant behavior.
2638+
/// </summary>
2639+
public McpOAuthTokenStorageMode? McpOAuthTokenStorage { get; set; }
2640+
26192641
/// <summary>Custom agent configurations for the session.</summary>
26202642
public IList<CustomAgentConfig>? CustomAgents { get; set; }
26212643

dotnet/test/Unit/CloneTests.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void SessionConfig_Clone_CopiesAllProperties()
7777
EnableSessionTelemetry = false,
7878
IncludeSubAgentStreamingEvents = false,
7979
McpServers = new Dictionary<string, McpServerConfig> { ["server1"] = new McpStdioServerConfig { Command = "echo" } },
80+
McpOAuthTokenStorage = McpOAuthTokenStorageMode.Persistent,
8081
CustomAgents = [new CustomAgentConfig { Name = "agent1", Model = "claude-haiku-4.5" }],
8182
Agent = "agent1",
8283
Cloud = new CloudSessionOptions
@@ -113,6 +114,7 @@ public void SessionConfig_Clone_CopiesAllProperties()
113114
Assert.Equal(original.EnableSessionTelemetry, clone.EnableSessionTelemetry);
114115
Assert.Equal(original.IncludeSubAgentStreamingEvents, clone.IncludeSubAgentStreamingEvents);
115116
Assert.Equal(original.McpServers.Count, clone.McpServers!.Count);
117+
Assert.Equal(original.McpOAuthTokenStorage, clone.McpOAuthTokenStorage);
116118
Assert.Equal(original.CustomAgents.Count, clone.CustomAgents!.Count);
117119
Assert.Equal(original.CustomAgents[0].Model, clone.CustomAgents[0].Model);
118120
Assert.Equal(original.Agent, clone.Agent);
@@ -420,4 +422,30 @@ public void ResumeSessionConfig_Clone_PreservesEnableSessionTelemetryDefault()
420422

421423
Assert.Null(clone.EnableSessionTelemetry);
422424
}
425+
426+
[Fact]
427+
public void SessionConfig_Clone_CopiesMcpOAuthTokenStorage()
428+
{
429+
var original = new SessionConfig
430+
{
431+
McpOAuthTokenStorage = McpOAuthTokenStorageMode.Persistent,
432+
};
433+
434+
var clone = original.Clone();
435+
436+
Assert.Equal(McpOAuthTokenStorageMode.Persistent, clone.McpOAuthTokenStorage);
437+
}
438+
439+
[Fact]
440+
public void ResumeSessionConfig_Clone_CopiesMcpOAuthTokenStorage()
441+
{
442+
var original = new ResumeSessionConfig
443+
{
444+
McpOAuthTokenStorage = McpOAuthTokenStorageMode.Persistent,
445+
};
446+
447+
var clone = original.Clone();
448+
449+
Assert.Equal(McpOAuthTokenStorageMode.Persistent, clone.McpOAuthTokenStorage);
450+
}
423451
}

go/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ func (c *Client) CreateSession(ctx context.Context, config *SessionConfig) (*Ses
629629
req.ModelCapabilities = config.ModelCapabilities
630630
req.WorkingDirectory = config.WorkingDirectory
631631
req.MCPServers = config.MCPServers
632+
req.MCPOAuthTokenStorage = config.MCPOAuthTokenStorage
632633
req.EnvValueMode = "direct"
633634
req.CustomAgents = config.CustomAgents
634635
req.DefaultAgent = config.DefaultAgent
@@ -958,6 +959,7 @@ func (c *Client) ResumeSessionWithOptions(ctx context.Context, sessionID string,
958959
req.ContinuePendingWork = Bool(true)
959960
}
960961
req.MCPServers = config.MCPServers
962+
req.MCPOAuthTokenStorage = config.MCPOAuthTokenStorage
961963
req.EnvValueMode = "direct"
962964
req.CustomAgents = config.CustomAgents
963965
req.DefaultAgent = config.DefaultAgent

go/client_test.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,70 @@ func TestResumeSessionRequest_InstructionDirectories(t *testing.T) {
619619
})
620620
}
621621

622+
func TestCreateSessionRequest_MCPOAuthTokenStorage(t *testing.T) {
623+
t.Run("includes mcpOAuthTokenStorage in JSON when set", func(t *testing.T) {
624+
req := createSessionRequest{MCPOAuthTokenStorage: "in-memory"}
625+
data, err := json.Marshal(req)
626+
if err != nil {
627+
t.Fatalf("Failed to marshal: %v", err)
628+
}
629+
var m map[string]any
630+
if err := json.Unmarshal(data, &m); err != nil {
631+
t.Fatalf("Failed to unmarshal: %v", err)
632+
}
633+
if m["mcpOAuthTokenStorage"] != "in-memory" {
634+
t.Errorf("Expected mcpOAuthTokenStorage to be 'in-memory', got %v", m["mcpOAuthTokenStorage"])
635+
}
636+
})
637+
638+
t.Run("omits mcpOAuthTokenStorage from JSON when empty", func(t *testing.T) {
639+
req := createSessionRequest{}
640+
data, err := json.Marshal(req)
641+
if err != nil {
642+
t.Fatalf("Failed to marshal: %v", err)
643+
}
644+
var m map[string]any
645+
if err := json.Unmarshal(data, &m); err != nil {
646+
t.Fatalf("Failed to unmarshal: %v", err)
647+
}
648+
if _, ok := m["mcpOAuthTokenStorage"]; ok {
649+
t.Error("Expected mcpOAuthTokenStorage to be omitted when empty")
650+
}
651+
})
652+
}
653+
654+
func TestResumeSessionRequest_MCPOAuthTokenStorage(t *testing.T) {
655+
t.Run("includes mcpOAuthTokenStorage in JSON when set", func(t *testing.T) {
656+
req := resumeSessionRequest{SessionID: "s1", MCPOAuthTokenStorage: "persistent"}
657+
data, err := json.Marshal(req)
658+
if err != nil {
659+
t.Fatalf("Failed to marshal: %v", err)
660+
}
661+
var m map[string]any
662+
if err := json.Unmarshal(data, &m); err != nil {
663+
t.Fatalf("Failed to unmarshal: %v", err)
664+
}
665+
if m["mcpOAuthTokenStorage"] != "persistent" {
666+
t.Errorf("Expected mcpOAuthTokenStorage to be 'persistent', got %v", m["mcpOAuthTokenStorage"])
667+
}
668+
})
669+
670+
t.Run("omits mcpOAuthTokenStorage from JSON when empty", func(t *testing.T) {
671+
req := resumeSessionRequest{SessionID: "s1"}
672+
data, err := json.Marshal(req)
673+
if err != nil {
674+
t.Fatalf("Failed to marshal: %v", err)
675+
}
676+
var m map[string]any
677+
if err := json.Unmarshal(data, &m); err != nil {
678+
t.Fatalf("Failed to unmarshal: %v", err)
679+
}
680+
if _, ok := m["mcpOAuthTokenStorage"]; ok {
681+
t.Error("Expected mcpOAuthTokenStorage to be omitted when empty")
682+
}
683+
})
684+
}
685+
622686
func TestOverridesBuiltInTool(t *testing.T) {
623687
t.Run("OverridesBuiltInTool is serialized in tool definition", func(t *testing.T) {
624688
tool := Tool{

go/mode_empty.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ func (c *Client) applyConfigDefaultsForMode(config *SessionConfig) {
126126
f := false
127127
config.EnableSessionTelemetry = &f
128128
}
129+
if config.MCPOAuthTokenStorage == "" {
130+
config.MCPOAuthTokenStorage = "in-memory"
131+
}
129132
}
130133

131134
func (c *Client) applyResumeDefaultsForMode(config *ResumeSessionConfig) {
@@ -136,6 +139,9 @@ func (c *Client) applyResumeDefaultsForMode(config *ResumeSessionConfig) {
136139
f := false
137140
config.EnableSessionTelemetry = &f
138141
}
142+
if config.MCPOAuthTokenStorage == "" {
143+
config.MCPOAuthTokenStorage = "in-memory"
144+
}
139145
}
140146

141147
// updateSessionOptionsForMode applies the per-mode safe-defaults patch via

go/toolset_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,30 @@ func TestApplyConfigDefaultsForMode_copilotCliLeavesNil(t *testing.T) {
247247
t.Errorf("non-empty mode must not default telemetry")
248248
}
249249
}
250+
251+
func TestApplyConfigDefaultsForMode_emptyDefaultsMCPOAuthTokenStorage(t *testing.T) {
252+
c := NewClient(&ClientOptions{Mode: ModeEmpty, BaseDirectory: t.TempDir()})
253+
cfg := &SessionConfig{}
254+
c.applyConfigDefaultsForMode(cfg)
255+
if cfg.MCPOAuthTokenStorage != "in-memory" {
256+
t.Errorf("expected MCPOAuthTokenStorage 'in-memory' in empty mode, got %q", cfg.MCPOAuthTokenStorage)
257+
}
258+
}
259+
260+
func TestApplyConfigDefaultsForMode_emptyHonorsCallerMCPOAuthTokenStorage(t *testing.T) {
261+
c := NewClient(&ClientOptions{Mode: ModeEmpty, BaseDirectory: t.TempDir()})
262+
cfg := &SessionConfig{MCPOAuthTokenStorage: "persistent"}
263+
c.applyConfigDefaultsForMode(cfg)
264+
if cfg.MCPOAuthTokenStorage != "persistent" {
265+
t.Errorf("caller-supplied MCPOAuthTokenStorage must win, got %q", cfg.MCPOAuthTokenStorage)
266+
}
267+
}
268+
269+
func TestApplyConfigDefaultsForMode_copilotCliLeavesMCPOAuthTokenStorageEmpty(t *testing.T) {
270+
c := NewClient(&ClientOptions{Mode: ModeCopilotCli})
271+
cfg := &SessionConfig{}
272+
c.applyConfigDefaultsForMode(cfg)
273+
if cfg.MCPOAuthTokenStorage != "" {
274+
t.Errorf("non-empty mode must not default MCPOAuthTokenStorage, got %q", cfg.MCPOAuthTokenStorage)
275+
}
276+
}

go/types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,11 @@ type SessionConfig struct {
965965
ModelCapabilities *rpc.ModelCapabilitiesOverride
966966
// MCPServers configures MCP servers for the session
967967
MCPServers map[string]MCPServerConfig
968+
// MCPOAuthTokenStorage controls how MCP OAuth tokens are stored for this session.
969+
// "persistent" stores tokens in the OS keychain (shared across sessions).
970+
// "in-memory" stores tokens in memory and discards them when the session ends.
971+
// Defaults to "in-memory" for safe multitenant behavior.
972+
MCPOAuthTokenStorage string
968973
// CustomAgents configures custom agents for the session
969974
CustomAgents []CustomAgentConfig
970975
// DefaultAgent configures the default agent (the built-in agent that handles turns when no custom agent is selected).
@@ -1287,6 +1292,11 @@ type ResumeSessionConfig struct {
12871292
IncludeSubAgentStreamingEvents *bool
12881293
// MCPServers configures MCP servers for the session
12891294
MCPServers map[string]MCPServerConfig
1295+
// MCPOAuthTokenStorage controls how MCP OAuth tokens are stored for this session.
1296+
// "persistent" stores tokens in the OS keychain (shared across sessions).
1297+
// "in-memory" stores tokens in memory and discards them when the session ends.
1298+
// Defaults to "in-memory" for safe multitenant behavior.
1299+
MCPOAuthTokenStorage string
12901300
// CustomAgents configures custom agents for the session
12911301
CustomAgents []CustomAgentConfig
12921302
// DefaultAgent configures the default agent (the built-in agent that handles turns when no custom agent is selected).
@@ -1602,6 +1612,7 @@ type createSessionRequest struct {
16021612
Streaming *bool `json:"streaming,omitempty"`
16031613
IncludeSubAgentStreamingEvents *bool `json:"includeSubAgentStreamingEvents,omitempty"`
16041614
MCPServers map[string]MCPServerConfig `json:"mcpServers,omitempty"`
1615+
MCPOAuthTokenStorage string `json:"mcpOAuthTokenStorage,omitempty"`
16051616
EnvValueMode string `json:"envValueMode,omitempty"`
16061617
CustomAgents []CustomAgentConfig `json:"customAgents,omitempty"`
16071618
DefaultAgent *DefaultAgentConfig `json:"defaultAgent,omitempty"`
@@ -1673,6 +1684,7 @@ type resumeSessionRequest struct {
16731684
Streaming *bool `json:"streaming,omitempty"`
16741685
IncludeSubAgentStreamingEvents *bool `json:"includeSubAgentStreamingEvents,omitempty"`
16751686
MCPServers map[string]MCPServerConfig `json:"mcpServers,omitempty"`
1687+
MCPOAuthTokenStorage string `json:"mcpOAuthTokenStorage,omitempty"`
16761688
EnvValueMode string `json:"envValueMode,omitempty"`
16771689
CustomAgents []CustomAgentConfig `json:"customAgents,omitempty"`
16781690
DefaultAgent *DefaultAgentConfig `json:"defaultAgent,omitempty"`

java/src/main/java/com/github/copilot/CopilotClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ public CompletableFuture<CopilotSession> createSession(SessionConfig config) {
512512
+ "the tools it wants — e.g. setAvailableTools(new ToolSet().addBuiltIn(BuiltInTools.ISOLATED)).");
513513
}
514514
request.setToolFilterPrecedence("excluded");
515+
if (request.getMcpOAuthTokenStorage() == null) {
516+
request.setMcpOAuthTokenStorage("in-memory");
517+
}
515518
}
516519

517520
long rpcNanos = System.nanoTime();
@@ -626,6 +629,9 @@ public CompletableFuture<CopilotSession> resumeSession(String sessionId, ResumeS
626629
+ "the tools it wants — e.g. setAvailableTools(new ToolSet().addBuiltIn(BuiltInTools.ISOLATED)).");
627630
}
628631
request.setToolFilterPrecedence("excluded");
632+
if (request.getMcpOAuthTokenStorage() == null) {
633+
request.setMcpOAuthTokenStorage("in-memory");
634+
}
629635
}
630636

631637
long rpcNanos = System.nanoTime();

java/src/main/java/com/github/copilot/SessionRequestBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ static CreateSessionRequest buildCreateRequest(SessionConfig config, String sess
125125
}
126126
config.getIncludeSubAgentStreamingEvents().ifPresent(request::setIncludeSubAgentStreamingEvents);
127127
request.setMcpServers(config.getMcpServers());
128+
request.setMcpOAuthTokenStorage(config.getMcpOAuthTokenStorage());
128129
request.setCustomAgents(config.getCustomAgents());
129130
request.setDefaultAgent(config.getDefaultAgent());
130131
request.setAgent(config.getAgent());
@@ -227,6 +228,7 @@ static ResumeSessionRequest buildResumeRequest(String sessionId, ResumeSessionCo
227228
}
228229
config.getIncludeSubAgentStreamingEvents().ifPresent(request::setIncludeSubAgentStreamingEvents);
229230
request.setMcpServers(config.getMcpServers());
231+
request.setMcpOAuthTokenStorage(config.getMcpOAuthTokenStorage());
230232
request.setCustomAgents(config.getCustomAgents());
231233
request.setDefaultAgent(config.getDefaultAgent());
232234
request.setAgent(config.getAgent());

0 commit comments

Comments
 (0)