Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/agent/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,10 @@ impl Agent {
.can_push()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

.map_err(|e| PromoteError::QueueFull(Box::new(e)))?;

let message = self.follow_up_queue.remove(id).ok_or(PromoteError::NotFound)?;
let message = self
.follow_up_queue
.remove(id)
.ok_or(PromoteError::NotFound)?;
let source_remaining = self.follow_up_queue.len();
self.emit_queue_event(QueueEvent::Removed {
kind: QueueKind::FollowUp,
Expand Down
18 changes: 14 additions & 4 deletions tests/test_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,11 @@ fn test_promote_follow_up_event_sequence() {

assert!(matches!(
&captured[0],
QueueEvent::Removed { kind: QueueKind::FollowUp, count: 1, .. }
QueueEvent::Removed {
kind: QueueKind::FollowUp,
count: 1,
..
}
));
assert!(matches!(
&captured[1],
Expand All @@ -631,7 +635,11 @@ fn test_promote_follow_up_event_sequence() {
));
assert!(matches!(
&captured[2],
QueueEvent::Enqueued { kind: QueueKind::Steering, count: 1, .. }
QueueEvent::Enqueued {
kind: QueueKind::Steering,
count: 1,
..
}
));
}

Expand Down Expand Up @@ -677,7 +685,10 @@ fn test_try_promote_follow_up_not_found() {
#[test]
fn test_promote_error_display() {
let not_found = PromoteError::NotFound;
assert_eq!(format!("{}", not_found), "message not found in follow-up queue");
assert_eq!(
format!("{}", not_found),
"message not found in follow-up queue"
);

// Construct a QueueFullError via Agent-level try_steer (which calls try_push)
let agent = Agent::new();
Expand Down Expand Up @@ -726,4 +737,3 @@ fn test_queue_full_error_into_message() {
let err2 = QueueFullError::new(1, 1);
assert!(err2.into_message().is_none());
}

10 changes: 8 additions & 2 deletions tests/test_agent_new_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,10 @@ async fn test_has_queued_messages_async_caches_supplier_output() {
);

// Verify messages actually ended up in the local queue
assert!(agent.has_queued_messages(), "local queue should be populated");
assert!(
agent.has_queued_messages(),
"local queue should be populated"
);
}

/// Test that `has_queued_messages_async` probes V2 steering suppliers.
Expand Down Expand Up @@ -2409,5 +2412,8 @@ async fn test_has_queued_messages_async_probes_v2_supplier() {
);

// Messages should have been cached into local queue
assert!(agent.has_queued_messages(), "V2 supplier messages should be cached");
assert!(
agent.has_queued_messages(),
"V2 supplier messages should be cached"
);
}
Loading