Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 128 additions & 128 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ encoding_rs = "0.8"
exec = "0.3.1"
fancy-regex = "0.17.0"
fork = "0.4.0"
futures = "0.3"
futures = "0.3.32"
futures-concurrency = "7.7.1"
futures-lite = "1.13"
gh-workflow = { git = "https://github.com/zed-industries/gh-workflow", rev = "37f3c0575d379c218a9c455ee67585184e40d43f" }
Expand Down
2 changes: 1 addition & 1 deletion crates/agent/src/edit_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ mod tests {
stream: &mut UnboundedReceiver<EditAgentOutputEvent>,
) -> Vec<EditAgentOutputEvent> {
let mut events = Vec::new();
while let Ok(Some(event)) = stream.try_next() {
while let Ok(event) = stream.try_recv() {
events.push(event);
}
events
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6206,9 +6206,9 @@ async fn test_edit_file_tool_allow_rule_skips_confirmation(cx: &mut TestAppConte

cx.run_until_parked();

let event = rx.try_next();
let event = rx.try_recv();
assert!(
!matches!(event, Ok(Some(Ok(ThreadEvent::ToolCallAuthorization(_))))),
!matches!(event, Ok(Ok(ThreadEvent::ToolCallAuthorization(_)))),
"expected no authorization request for allowed .md file"
);
}
Expand Down Expand Up @@ -6350,9 +6350,9 @@ async fn test_fetch_tool_allow_rule_skips_confirmation(cx: &mut TestAppContext)

cx.run_until_parked();

let event = rx.try_next();
let event = rx.try_recv();
assert!(
!matches!(event, Ok(Some(Ok(ThreadEvent::ToolCallAuthorization(_))))),
!matches!(event, Ok(Ok(ThreadEvent::ToolCallAuthorization(_)))),
"expected no authorization request for allowed docs.rs URL"
);
}
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/copy_path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down Expand Up @@ -450,8 +450,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/create_directory_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down Expand Up @@ -440,8 +440,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/delete_path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down Expand Up @@ -513,8 +513,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down
18 changes: 9 additions & 9 deletions crates/agent/src/tools/edit_file_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// Test 4: Path with .zed in the middle should require confirmation
let (stream_tx, mut stream_rx) = ToolCallEventStream::test();
Expand Down Expand Up @@ -1251,7 +1251,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// 5.3: Normal in-project path with allow — no confirmation needed
let (stream_tx, mut stream_rx) = ToolCallEventStream::test();
Expand All @@ -1268,7 +1268,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// 5.4: With Confirm default, non-project paths still prompt
cx.update(|cx| {
Expand Down Expand Up @@ -1586,8 +1586,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
stream_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
stream_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down Expand Up @@ -1658,7 +1658,7 @@ mod tests {
} else {
auth.await.unwrap();
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -1769,7 +1769,7 @@ mod tests {
} else {
auth.await.unwrap();
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -1862,7 +1862,7 @@ mod tests {
stream_rx.expect_authorization().await;
} else {
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -1963,7 +1963,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());
}
}

Expand Down
18 changes: 6 additions & 12 deletions crates/agent/src/tools/list_directory_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,13 +982,11 @@ mod tests {
"Expected private path validation error, got: {error}"
);

let event = event_rx.try_next();
let event = event_rx.try_recv();
assert!(
!matches!(
event,
Ok(Some(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(
_
))))
Ok(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(_)))
),
"No authorization should be requested when validation fails before listing",
);
Expand Down Expand Up @@ -1030,13 +1028,11 @@ mod tests {
"Normal path should succeed without authorization"
);

let event = event_rx.try_next();
let event = event_rx.try_recv();
assert!(
!matches!(
event,
Ok(Some(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(
_
))))
Ok(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(_)))
),
"No authorization should be requested for normal paths",
);
Expand Down Expand Up @@ -1087,13 +1083,11 @@ mod tests {
"Intra-project symlink should succeed without authorization: {result:?}",
);

let event = event_rx.try_next();
let event = event_rx.try_recv();
assert!(
!matches!(
event,
Ok(Some(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(
_
))))
Ok(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(_)))
),
"No authorization should be requested for intra-project symlinks",
);
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/move_path_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down Expand Up @@ -457,8 +457,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down
6 changes: 2 additions & 4 deletions crates/agent/src/tools/read_file_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,13 +1317,11 @@ mod test {
"Expected private-files validation error, got: {error}"
);

let event = event_rx.try_next();
let event = event_rx.try_recv();
assert!(
!matches!(
event,
Ok(Some(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(
_
))))
Ok(Ok(crate::thread::ThreadEvent::ToolCallAuthorization(_)))
),
"No authorization should be requested when validation fails before read",
);
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/restore_file_from_disk_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down Expand Up @@ -662,8 +662,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down
8 changes: 4 additions & 4 deletions crates/agent/src/tools/save_file_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down Expand Up @@ -657,8 +657,8 @@ mod tests {

assert!(
!matches!(
event_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
event_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Expected a single authorization prompt",
);
Expand Down
18 changes: 9 additions & 9 deletions crates/agent/src/tools/streaming_edit_file_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// Test 4: Path with .zed in the middle should require confirmation
let (stream_tx, mut stream_rx) = ToolCallEventStream::test();
Expand Down Expand Up @@ -2540,7 +2540,7 @@ mod tests {
cx.update(|cx| tool.authorize(&PathBuf::from("/etc/hosts"), "test 5.2", &stream_tx, cx))
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// 5.3: Normal in-project path with allow — no confirmation needed
let (stream_tx, mut stream_rx) = ToolCallEventStream::test();
Expand All @@ -2554,7 +2554,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());

// 5.4: With Confirm default, non-project paths still prompt
cx.update(|cx| {
Expand Down Expand Up @@ -2767,8 +2767,8 @@ mod tests {
assert!(result.is_err(), "Tool should fail when policy denies");
assert!(
!matches!(
stream_rx.try_next(),
Ok(Some(Ok(crate::ThreadEvent::ToolCallAuthorization(_))))
stream_rx.try_recv(),
Ok(Ok(crate::ThreadEvent::ToolCallAuthorization(_)))
),
"Deny policy should not emit symlink authorization prompt",
);
Expand Down Expand Up @@ -2810,7 +2810,7 @@ mod tests {
} else {
auth.await.unwrap();
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -2887,7 +2887,7 @@ mod tests {
} else {
auth.await.unwrap();
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -2947,7 +2947,7 @@ mod tests {
stream_rx.expect_authorization().await;
} else {
assert!(
stream_rx.try_next().is_err(),
stream_rx.try_recv().is_err(),
"Failed for case: {} - path: {} - expected no confirmation but got one",
description,
path
Expand Down Expand Up @@ -3015,7 +3015,7 @@ mod tests {
})
.await
.unwrap();
assert!(stream_rx.try_next().is_err());
assert!(stream_rx.try_recv().is_err());
}
}

Expand Down
Loading
Loading