This commit is contained in:
jimmyfraiture
2025-09-24 14:11:37 +01:00
parent 6aa1066001
commit 542297e067
2 changed files with 23 additions and 14 deletions

View File

@@ -2272,6 +2272,9 @@ async fn handle_response_item(
action,
} => {
let LocalShellAction::Exec(action) = action;
if let Some(flag) = turn_readiness.as_ref() {
flag.wait_ready().await;
}
tracing::info!("LocalShellCall: {action:?}");
let params = ShellToolCallParams {
command: action.command,
@@ -2314,18 +2317,23 @@ async fn handle_response_item(
name,
input,
status: _,
} => Some(
handle_custom_tool_call(
sess,
turn_state,
turn_context,
sub_id.to_string(),
name,
input,
call_id,
} => {
if let Some(flag) = turn_readiness.as_ref() {
flag.wait_ready().await;
}
Some(
handle_custom_tool_call(
sess,
turn_state,
turn_context,
sub_id.to_string(),
name,
input,
call_id,
)
.await,
)
.await,
),
},
ResponseItem::FunctionCallOutput { .. } => {
debug!("unexpected FunctionCallOutput from stream");
None

View File

@@ -1137,9 +1137,7 @@ impl ChatWidget {
let repo_path = self.config.cwd.clone();
let app_event_tx = self.app_event_tx.clone();
tokio::spawn(async move {
if let Ok(token) = readiness_to_mark.subscribe().await {
let _ = readiness_to_mark.mark_ready(token).await;
}
let readiness_token = readiness_to_mark.subscribe().await.ok();
if capture_snapshot {
let event = match spawn_blocking(move || {
let options = CreateGhostCommitOptions::new(repo_path.as_path());
@@ -1184,6 +1182,9 @@ impl ChatWidget {
};
app_event_tx.send(event);
}
if let Some(token) = readiness_token {
let _ = readiness_to_mark.mark_ready(token).await;
}
});
let mut items: Vec<InputItem> = Vec::new();