File tree Expand file tree Collapse file tree 4 files changed +298
-221
lines changed
Expand file tree Collapse file tree 4 files changed +298
-221
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,7 @@ impl ExtensionManager {
488488 context : PlatformExtensionContext {
489489 extension_manager : None ,
490490 session_manager,
491+ session : None ,
491492 } ,
492493 provider,
493494 tools_cache : Mutex :: new ( None ) ,
@@ -715,6 +716,11 @@ impl ExtensionManager {
715716 } ) ?;
716717 let mut context = self . context . clone ( ) ;
717718 context. extension_manager = Some ( Arc :: downgrade ( self ) ) ;
719+ if let Some ( id) = session_id {
720+ if let Ok ( session) = self . context . session_manager . get_session ( id, false ) . await {
721+ context. session = Some ( Arc :: new ( session) ) ;
722+ }
723+ }
718724
719725 ( def. client_factory ) ( context)
720726 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub mod tom;
99use std:: collections:: HashMap ;
1010
1111use crate :: agents:: mcp_client:: McpClientTrait ;
12+ use crate :: session:: Session ;
1213use once_cell:: sync:: Lazy ;
1314
1415pub use ext_manager:: MANAGE_EXTENSIONS_TOOL_NAME_COMPLETE ;
@@ -124,6 +125,7 @@ pub struct PlatformExtensionContext {
124125 pub extension_manager :
125126 Option < std:: sync:: Weak < crate :: agents:: extension_manager:: ExtensionManager > > ,
126127 pub session_manager : std:: sync:: Arc < crate :: session:: SessionManager > ,
128+ pub session : Option < std:: sync:: Arc < Session > > ,
127129}
128130
129131impl PlatformExtensionContext {
You can’t perform that action at this time.
0 commit comments