mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Expose session sources to MCP contributors (#37167)
## What changed - Add `session_source()` to `McpServerContributionContext` for thread-scoped MCP resolution. - Propagate each thread's `SessionSource` through initial setup, per-step resolution, and runtime refreshes. ## Testing - Verify global contexts omit the source while thread-scoped contexts retain it. - Verify MCP contributors observe distinct sources for a root thread and its spawned subagent. GitOrigin-RevId: 23da1509858e023fbd9e2d179034ddc83553f17b
This commit is contained in:
1 parent
ad6e48ddd3
commit
15ea598c6e
9 files changed
+239
-24
No files matched your search
@@ -738,6 +738,7 @@ impl Session {
|
||||
let mcp_thread_init_for_startup = &mcp_thread_init;
|
||||
let thread_extension_data_for_mcp = &thread_extension_data;
|
||||
let mcp_originator = session_configuration.originator.clone();
|
||||
let mcp_session_source = session_configuration.session_source.clone();
|
||||
let mcp_runtime_cwd = session_configuration
|
||||
.environment_selections()
|
||||
.first()
|
||||
@@ -751,7 +752,10 @@ impl Session {
|
||||
&config_for_mcp,
|
||||
mcp_thread_init_for_startup,
|
||||
thread_extension_data_for_mcp,
|
||||
&mcp_originator,
|
||||
McpThreadIdentity {
|
||||
session_source: &mcp_session_source,
|
||||
originator: &mcp_originator,
|
||||
},
|
||||
/*ready_selected_capability_roots*/ &[],
|
||||
/*executor_capability_discovery*/ None,
|
||||
)
|
||||
@@ -1271,7 +1275,10 @@ impl Session {
|
||||
config.as_ref(),
|
||||
&sess.services.mcp_thread_init,
|
||||
&sess.services.thread_extension_data,
|
||||
&session_configuration.originator,
|
||||
McpThreadIdentity {
|
||||
session_source: &session_configuration.session_source,
|
||||
originator: &session_configuration.originator,
|
||||
},
|
||||
/*ready_selected_capability_roots*/ &[],
|
||||
/*executor_capability_discovery*/ None,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user