This commit is contained in:
Agus Zubiaga 2025-08-12 09:53:21 -03:00
parent 0741c30653
commit 76566aaa78

View file

@ -310,13 +310,15 @@ async fn test_tool_authorization(cx: &mut TestAppContext) {
let message = completion.messages.last().unwrap(); let message = completion.messages.last().unwrap();
assert_eq!( assert_eq!(
message.content, message.content,
vec![MessageContent::ToolResult(LanguageModelToolResult { vec![language_model::MessageContent::ToolResult(
tool_use_id: tool_call_auth_3.tool_call.id.0.to_string().into(), LanguageModelToolResult {
tool_name: ToolRequiringPermission.name().into(), tool_use_id: tool_call_auth_3.tool_call.id.0.to_string().into(),
is_error: false, tool_name: ToolRequiringPermission.name().into(),
content: "Allowed".into(), is_error: false,
output: Some("Allowed".into()) content: "Allowed".into(),
})] output: Some("Allowed".into())
}
)]
); );
// Simulate a final tool call, ensuring we don't trigger authorization. // Simulate a final tool call, ensuring we don't trigger authorization.
@ -335,13 +337,15 @@ async fn test_tool_authorization(cx: &mut TestAppContext) {
let message = completion.messages.last().unwrap(); let message = completion.messages.last().unwrap();
assert_eq!( assert_eq!(
message.content, message.content,
vec![MessageContent::ToolResult(LanguageModelToolResult { vec![language_model::MessageContent::ToolResult(
tool_use_id: "tool_id_4".into(), LanguageModelToolResult {
tool_name: ToolRequiringPermission.name().into(), tool_use_id: "tool_id_4".into(),
is_error: false, tool_name: ToolRequiringPermission.name().into(),
content: "Allowed".into(), is_error: false,
output: Some("Allowed".into()) content: "Allowed".into(),
})] output: Some("Allowed".into())
}
)]
); );
} }