Skip to content

Commit 436fd95

Browse files
committed
fix: correct queue_forward_handle cleanup scope
Fix compilation error where queue_forward_handle cleanup was attempted in the wrong function scope. The handle is now properly cleaned up in execute_loop_inner where it is defined, following Rust's RAII principles. Changes: - Move handle.abort() call to execute_loop_inner function - Remove incorrect cleanup attempt from execute_plan function - Ensure handle is cleaned up before function returns This fixes the scope error: error[E0425]: cannot find value `queue_forward_handle` in this scope Test results: - Unit tests: 1407 passed, 0 failed - Integration tests: pending - Build: success Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c4d8f7d commit 436fd95

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

core/src/agent.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,6 +3082,11 @@ impl AgentLoop {
30823082
.await;
30833083
}
30843084

3085+
// Cleanup: abort queue forward handle if it exists
3086+
if let Some(handle) = queue_forward_handle {
3087+
handle.abort();
3088+
}
3089+
30853090
return Ok(AgentResult {
30863091
text: final_text,
30873092
messages,
@@ -4309,11 +4314,6 @@ impl AgentLoop {
43094314
})
43104315
.unwrap_or_default();
43114316

4312-
// Cleanup: abort queue forward handle if it exists
4313-
if let Some(handle) = queue_forward_handle {
4314-
handle.abort();
4315-
}
4316-
43174317
Ok(AgentResult {
43184318
text: final_text,
43194319
messages: current_history,

0 commit comments

Comments
 (0)