Refactor ToolCallStatus enum to flat variants (#36356)

Replace nested Allowed variant with distinct statuses for clearer status
handling.

Release Notes:

- N/A
This commit is contained in:
Ben Brandt 2025-08-17 15:05:23 +02:00 committed by GitHub
parent da8a692ec0
commit 5895fac377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 72 additions and 70 deletions

View file

@ -134,7 +134,9 @@ pub async fn test_tool_call(server: impl AgentServer + 'static, cx: &mut TestApp
matches!(
entry,
AgentThreadEntry::ToolCall(ToolCall {
status: ToolCallStatus::Allowed { .. },
status: ToolCallStatus::Pending
| ToolCallStatus::InProgress
| ToolCallStatus::Completed,
..
})
)
@ -212,7 +214,9 @@ pub async fn test_tool_call_with_permission(
assert!(thread.entries().iter().any(|entry| matches!(
entry,
AgentThreadEntry::ToolCall(ToolCall {
status: ToolCallStatus::Allowed { .. },
status: ToolCallStatus::Pending
| ToolCallStatus::InProgress
| ToolCallStatus::Completed,
..
})
)));
@ -223,7 +227,9 @@ pub async fn test_tool_call_with_permission(
thread.read_with(cx, |thread, cx| {
let AgentThreadEntry::ToolCall(ToolCall {
content,
status: ToolCallStatus::Allowed { .. },
status: ToolCallStatus::Pending
| ToolCallStatus::InProgress
| ToolCallStatus::Completed,
..
}) = thread
.entries()