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:
Abhijay Jain
2025-12-23 15:54:47 +05:30
committed by GitHub
parent 2f876725d3
commit 79ee3c31f8
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ async fn resume_agent(
})?;
agent
.update_provider(provider, &payload.session_id)
.load_provider(provider)
.await
.map_err(|e| ErrorResponse {
message: format!("Could not configure agent: {}", e),
+8
View File
@@ -1388,6 +1388,14 @@ impl Agent {
.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(
&self,
provider: Option<Arc<dyn Provider>>,