mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-21 00:02:30 +00:00
fix: keep the failure reason and web search citations on tool rows
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
d08a324d54
commit
8da42eb8c7
@@ -711,12 +711,19 @@ async fn handle_tool_execution_error(
|
||||
}
|
||||
|
||||
// Add tool message to conversation if chat_input_enabled (error case). Worded from the
|
||||
// tool like every other tool row; nothing is put on the row because the tool's own job
|
||||
// holds it — `handle_non_flow_job_error` above completed that job with this error, and it
|
||||
// was pushed with the arguments the step's input transforms produced rather than the raw
|
||||
// ones the model supplied.
|
||||
// tool like every other tool row, with the error as the row's result so the reason
|
||||
// survives a reload. The arguments are not put on the row: the tool's job was pushed
|
||||
// with the ones the step's input transforms produced, not the raw ones the model
|
||||
// supplied, and the job holds those.
|
||||
let content = format!("Error executing {}", tool_call.function.name);
|
||||
add_tool_message_to_chat(ctx, Some(job_id), &content, false, None).await;
|
||||
add_tool_message_to_chat(
|
||||
ctx,
|
||||
Some(job_id),
|
||||
&content,
|
||||
false,
|
||||
Some(MessageExtras { tool_result: Some(error_message.clone()), ..Default::default() }),
|
||||
)
|
||||
.await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1524,7 +1524,9 @@ pub async fn run_agent(
|
||||
if let Some(memory_id) = memory_id {
|
||||
let agent_job_id = job.id;
|
||||
let db_clone = db.clone();
|
||||
let message_content = "Used websearch tool successfully".to_string();
|
||||
// Worded like every other tool row, so a reader recovers the
|
||||
// tool name from the sentence and keeps the citations below.
|
||||
let message_content = "Used websearch tool".to_string();
|
||||
let step_name = step_name.clone();
|
||||
// The search ran inside the provider's call, so this job's args
|
||||
// describe the agent, not the search: its sources reach the row
|
||||
|
||||
Reference in New Issue
Block a user