chore: refactor read-write lock on agent (#2225)

Co-authored-by: Alice Hau <ahau@squareup.com>
This commit is contained in:
Salman Mohammed
2025-04-23 23:46:22 -03:00
committed by GitHub
parent 85e2ee3984
commit 199fa6adbc
24 changed files with 409 additions and 237 deletions
+3 -3
View File
@@ -285,7 +285,7 @@ impl Session {
async fn process_message(&mut self, message: String) -> Result<()> {
self.messages.push(Message::user().with_text(&message));
// Get the provider from the agent for description generation
let provider = self.agent.provider();
let provider = self.agent.provider().await?;
// Persist messages with provider for automatic description generation
session::persist_messages(&self.session_file, &self.messages, Some(provider)).await?;
@@ -357,7 +357,7 @@ impl Session {
self.messages.push(Message::user().with_text(&content));
// Get the provider from the agent for description generation
let provider = self.agent.provider();
let provider = self.agent.provider().await?;
// Persist messages with provider for automatic description generation
session::persist_messages(
@@ -526,7 +526,7 @@ impl Session {
output::render_message(&plan_response, self.debug);
output::hide_thinking();
let planner_response_type =
classify_planner_response(plan_response.as_concat_text(), self.agent.provider())
classify_planner_response(plan_response.as_concat_text(), self.agent.provider().await?)
.await?;
match planner_response_type {