feat: add streaming end-to-end coverage
This commit is contained in:
@@ -520,8 +520,35 @@ async fn handle_base_tool_call(
|
||||
let operation = runtime_operation(&tool);
|
||||
let request_preview = build_request_preview(&state.runtime, &operation, &arguments);
|
||||
let started_at = Instant::now();
|
||||
let is_window_mode = matches!(
|
||||
operation
|
||||
.execution_config
|
||||
.streaming
|
||||
.as_ref()
|
||||
.map(|streaming| streaming.mode),
|
||||
Some(crank_core::ExecutionMode::Window)
|
||||
);
|
||||
|
||||
match state.runtime.execute(&operation, &arguments).await {
|
||||
let result = if is_window_mode {
|
||||
state
|
||||
.runtime
|
||||
.execute_window(&operation, &arguments)
|
||||
.await
|
||||
.map(|output| {
|
||||
json!({
|
||||
"summary": output.summary,
|
||||
"items": output.items,
|
||||
"cursor": output.cursor,
|
||||
"window_complete": output.window_complete,
|
||||
"truncated": output.truncated,
|
||||
"has_more": output.has_more,
|
||||
})
|
||||
})
|
||||
} else {
|
||||
state.runtime.execute(&operation, &arguments).await
|
||||
};
|
||||
|
||||
match result {
|
||||
Ok(output) => {
|
||||
let _ = persist_invocation(
|
||||
&state,
|
||||
|
||||
Reference in New Issue
Block a user