Add cancellation check after tool execution in harness chat loop
This allows the user to interrupt between rapid tool calls. When Ctrl+C is pressed during a sequence of tool calls, the harness now stops processing rather than completing the entire batch. The check follows the same semantics as the existing cancellation checks: returns empty string (success) to preserve conversation state in the chat file.
This commit is contained in:
@@ -161,6 +161,12 @@ std::expected<std::string, std::string> Harness::chat(const Message& user_messag
|
||||
tool_result.content = result;
|
||||
push_message(tool_result);
|
||||
}
|
||||
|
||||
if (ctrlc_request)
|
||||
// Cancellation after tool execution: same semantics as above -
|
||||
// return empty string to preserve conversation state in the chat file.
|
||||
return "";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user