force WAL sync after session create (#5202)
This commit is contained in:
@@ -218,7 +218,7 @@ where
|
||||
.update_provider(provider_arc as Arc<dyn goose::providers::base::Provider>)
|
||||
.await?;
|
||||
|
||||
let mut session = CliSession::new(agent, None, false, None, None, None, None);
|
||||
let mut session = CliSession::new(agent, None, false, None, None, None, None).await;
|
||||
|
||||
let mut error = None;
|
||||
for message in &messages {
|
||||
|
||||
@@ -133,7 +133,7 @@ async fn offer_extension_debugging_help(
|
||||
}
|
||||
|
||||
// Create the debugging session
|
||||
let mut debug_session = CliSession::new(debug_agent, None, false, None, None, None, None);
|
||||
let mut debug_session = CliSession::new(debug_agent, None, false, None, None, None, None).await;
|
||||
|
||||
// Process the debugging request
|
||||
println!("{}", style("Analyzing the extension failure...").yellow());
|
||||
@@ -465,7 +465,8 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> CliSession {
|
||||
session_config.max_turns,
|
||||
edit_mode,
|
||||
session_config.retry_config.clone(),
|
||||
);
|
||||
)
|
||||
.await;
|
||||
|
||||
// Add stdio extensions if provided
|
||||
for extension_str in session_config.extensions {
|
||||
|
||||
@@ -119,7 +119,7 @@ pub async fn classify_planner_response(
|
||||
}
|
||||
|
||||
impl CliSession {
|
||||
pub fn new(
|
||||
pub async fn new(
|
||||
agent: Agent,
|
||||
session_id: Option<String>,
|
||||
debug: bool,
|
||||
@@ -129,14 +129,10 @@ impl CliSession {
|
||||
retry_config: Option<RetryConfig>,
|
||||
) -> Self {
|
||||
let messages = if let Some(session_id) = &session_id {
|
||||
tokio::task::block_in_place(|| {
|
||||
tokio::runtime::Handle::current().block_on(async {
|
||||
SessionManager::get_session(session_id, true)
|
||||
.await
|
||||
.map(|session| session.conversation.unwrap_or_default())
|
||||
.unwrap()
|
||||
})
|
||||
})
|
||||
SessionManager::get_session(session_id, true)
|
||||
.await
|
||||
.map(|session| session.conversation.unwrap_or_default())
|
||||
.unwrap()
|
||||
} else {
|
||||
Conversation::new_unvalidated(Vec::new())
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user