Fix tool output not being displayed when there was an error
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
b249593abe
commit
253c6bc804
1 changed files with 12 additions and 2 deletions
|
@ -732,7 +732,17 @@ impl Thread {
|
||||||
stream.update_tool_call_fields(
|
stream.update_tool_call_fields(
|
||||||
&tool_use.id,
|
&tool_use.id,
|
||||||
acp::ToolCallUpdateFields {
|
acp::ToolCallUpdateFields {
|
||||||
status: Some(acp::ToolCallStatus::Completed),
|
status: Some(
|
||||||
|
tool_result
|
||||||
|
.as_ref()
|
||||||
|
.map_or(acp::ToolCallStatus::Failed, |result| {
|
||||||
|
if result.is_error {
|
||||||
|
acp::ToolCallStatus::Failed
|
||||||
|
} else {
|
||||||
|
acp::ToolCallStatus::Completed
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
),
|
||||||
raw_output: output,
|
raw_output: output,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
@ -1557,7 +1567,7 @@ impl Thread {
|
||||||
tool_name: tool_use.name,
|
tool_name: tool_use.name,
|
||||||
is_error: true,
|
is_error: true,
|
||||||
content: LanguageModelToolResultContent::Text(Arc::from(error.to_string())),
|
content: LanguageModelToolResultContent::Text(Arc::from(error.to_string())),
|
||||||
output: None,
|
output: Some(error.to_string().into()),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue