Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/goose-server/src/routes/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,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),
Expand Down
8 changes: 8 additions & 0 deletions crates/goose/src/agents/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd that this is needed?

.await
}

pub async fn update_router_tool_selector(
&self,
provider: Option<Arc<dyn Provider>>,
Expand Down