feature/ctrlc-cancel #49

Merged
darthrubik merged 17 commits from feature/ctrlc-cancel into master 2026-08-12 15:32:28 -05:00
Owner
No description provided.
darthrubik added 10 commits 2026-08-06 15:58:54 -05:00
Add platform-specific signal handling to enable Ctrl+C cancellation on Windows.
- Windows uses SetConsoleCtrlHandler with CTRL_C_EVENT
- Unix continues to use signal() with SIGINT
- Unified setup_signal_handler() function for both platforms
Add periodic ctrlc_request checks during directory traversal and file
processing in the grep_search tool. This allows the tool to respect user
cancellation (Ctrl+C) during recursive directory scanning of large codebases.

- Changed process_file to return bool indicating cancellation
- Added ctrlc_request check in directory iteration loop
- Added ctrlc_request check in file processing loop
- Returns early with cancellation message when cancelled

Closes issue #189
Add comments explaining that Harness::chat() returns an empty string
on Ctrl+C cancellation rather than std::unexpected. This preserves
the conversation state in the chat file, allowing users to resume
the conversation from the point of interruption.
Test verifies that when SIGINT (Ctrl+C) is sent to drharness during
shell command execution, the tool returns the expected
'[user requested halt of program]' message.
darthrubik added 7 commits 2026-08-06 16:23:41 -05:00
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.
Test verifies that sending SIGINT during tool execution stops processing
after that tool completes and prevents subsequent tool calls from running.
Conversation state is preserved in the chat file.
- Remove curl/curl.h include from ollama_client.hpp
- Remove xferinfo_cb static method declaration from OllamaClient class
- Make xferinfo_cb a file-scope static function in ollama_client.cpp

Closes: #195
darthrubik merged commit 6478617cb9 into master 2026-08-12 15:32:28 -05:00
darthrubik deleted branch feature/ctrlc-cancel 2026-08-12 15:32:28 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: darthrubik/drharness#49