test: fix test_max_turns_limit slow execution and wrong message type (#6221)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -387,7 +387,7 @@ mod tests {
|
|||||||
let session_config = SessionConfig {
|
let session_config = SessionConfig {
|
||||||
id: session.id,
|
id: session.id,
|
||||||
schedule_id: None,
|
schedule_id: None,
|
||||||
max_turns: None,
|
max_turns: Some(1),
|
||||||
retry_config: None,
|
retry_config: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -398,16 +398,18 @@ mod tests {
|
|||||||
while let Some(response_result) = reply_stream.next().await {
|
while let Some(response_result) = reply_stream.next().await {
|
||||||
match response_result {
|
match response_result {
|
||||||
Ok(AgentEvent::Message(response)) => {
|
Ok(AgentEvent::Message(response)) => {
|
||||||
if let Some(MessageContent::ToolConfirmationRequest(ref req)) =
|
if let Some(MessageContent::ActionRequired(action)) =
|
||||||
response.content.first()
|
response.content.first()
|
||||||
{
|
{
|
||||||
agent.handle_confirmation(
|
if let goose::conversation::message::ActionRequiredData::ToolConfirmation { id, .. } = &action.data {
|
||||||
req.id.clone(),
|
agent.handle_confirmation(
|
||||||
goose::permission::PermissionConfirmation {
|
id.clone(),
|
||||||
principal_type: goose::permission::permission_confirmation::PrincipalType::Tool,
|
goose::permission::PermissionConfirmation {
|
||||||
permission: goose::permission::Permission::AllowOnce,
|
principal_type: goose::permission::permission_confirmation::PrincipalType::Tool,
|
||||||
|
permission: goose::permission::Permission::AllowOnce,
|
||||||
|
}
|
||||||
|
).await;
|
||||||
}
|
}
|
||||||
).await;
|
|
||||||
}
|
}
|
||||||
responses.push(response);
|
responses.push(response);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user