fix : opening a session to view it modifies session history order in desktop (#6156)
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
@@ -288,7 +288,7 @@ async fn resume_agent(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
agent
|
agent
|
||||||
.update_provider(provider, &payload.session_id)
|
.load_provider(provider)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ErrorResponse {
|
.map_err(|e| ErrorResponse {
|
||||||
message: format!("Could not configure agent: {}", e),
|
message: format!("Could not configure agent: {}", e),
|
||||||
|
|||||||
@@ -1388,6 +1388,14 @@ impl Agent {
|
|||||||
.context("Failed to persist provider config to session")
|
.context("Failed to persist provider config to session")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn load_provider(&self, provider: Arc<dyn Provider>) -> Result<()> {
|
||||||
|
let mut current_provider = self.provider.lock().await;
|
||||||
|
*current_provider = Some(provider.clone());
|
||||||
|
|
||||||
|
self.update_router_tool_selector(Some(provider.clone()), None)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn update_router_tool_selector(
|
pub async fn update_router_tool_selector(
|
||||||
&self,
|
&self,
|
||||||
provider: Option<Arc<dyn Provider>>,
|
provider: Option<Arc<dyn Provider>>,
|
||||||
|
|||||||
Reference in New Issue
Block a user