320 Commits

Author SHA1 Message Date
darthrubik c6696490bd Merge pull request 'issue 215: Use OpenAI official API to list available models' (#58) from bugfix/fix-list-models into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/58
2026-08-12 19:21:44 -05:00
hal9000 afbf1c5484 issue 215: Use OpenAI official API to list available models
Changed list_models() to use the OpenAI-compatible /v1/models endpoint
instead of the Ollama-specific /api/tags endpoint. Updated ModelInfo and
ModelListResponse structs to match the OpenAI API response format.
2026-08-12 19:21:00 -05:00
darthrubik 34f317d38a Merge pull request 'bugfix/hanging-background-processes' (#54) from bugfix/hanging-background-processes into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/54
2026-08-12 16:08:30 -05:00
hal9000 8f50dd324b Remove unused fcntl.h include from shell_tool.cpp
The fcntl() calls for FD_CLOEXEC were removed in a previous commit but
the include statement was left behind. This removes the dead include.
2026-08-12 16:07:19 -05:00
darthrubik 4fbf19dd3b Removing extra slop the AI added 2026-08-12 16:00:43 -05:00
hal9000 0e2986b562 Fix shell tool hanging when command spawns background processes
The shell tool would hang indefinitely when running commands that spawn
background processes (e.g., 'sleep 10 &'). This was because:

1. Background processes inherit stdout, which points to our pipe
2. The original code read in a loop when POLLIN was detected
3. After reading available data, the second read() would block waiting
   for more data that never comes (since background process just sleeps)

The fix changes the POLLIN handler to read only once, then continue
polling. If POLLHUP is eventually set (when the background process is
killed by timeout), we'll read all remaining data then.

Additionally, FD_CLOEXEC is set on pipe file descriptors to prevent
inheritance during exec() calls (though this doesn't help with fork()
which is how shells spawn background processes).

Fixes issue 205 - failing unit tests.
2026-08-12 15:57:00 -05:00
darthrubik 95c415f06a Adding failing test for hanging background processes 2026-08-12 15:48:31 -05:00
darthrubik 3af0c1f0f7 Merge pull request 'feature/save-model-between-chats' (#52) from feature/save-model-between-chats into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/52
2026-08-12 15:41:38 -05:00
darthrubik 6c1906679d Merge remote-tracking branch 'origin/master' into feature/save-model-between-chats 2026-08-12 15:41:23 -05:00
darthrubik 6478617cb9 Merge pull request 'feature/ctrlc-cancel' (#49) from feature/ctrlc-cancel into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/49
2026-08-12 15:32:28 -05:00
darthrubik 8b1c7e9d3d Merge remote-tracking branch 'sandbox/195/work' into feature/ctrlc-cancel 2026-08-06 16:22:38 -05:00
hal9000 a3e044712f Move xferinfo_cb to ollama_client.cpp to avoid exposing libcurl in header
- 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
2026-08-06 21:22:10 +00:00
darthrubik ee7db0d87c Merge remote-tracking branch 'sandbox/194/work' into feature/ctrlc-cancel 2026-08-06 16:21:22 -05:00
hal9000 3bc2b61b5a Speed up ctrlc test by using shorter sleep (1s instead of 5s) 2026-08-06 21:20:46 +00:00
hal9000 64d8e5bb49 Add test for ctrlc cancellation after tool execution
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.
2026-08-06 21:17:03 +00:00
darthrubik 1d5a5b5e17 On second ctrlc immediately die 2026-08-06 16:07:47 -05:00
hal9000 b152b96520 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.
2026-08-06 21:06:14 +00:00
darthrubik ccc25e9ffd Merge remote-tracking branch 'sandbox/190/work' into feature/ctrlc-cancel 2026-08-06 15:44:49 -05:00
darthrubik dffa9d875b Merge remote-tracking branch 'sandbox/191/work' into feature/ctrlc-cancel 2026-08-06 15:41:35 -05:00
darthrubik e437fd8624 Merge remote-tracking branch 'sandbox/189/work' into feature/ctrlc-cancel 2026-08-06 15:41:25 -05:00
hal9000 bbc4f5acf0 Add unit test for ctrlc feature on shell tool (issue 193)
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.
2026-08-05 23:49:07 +00:00
hal9000 f2cefd243b Document return value semantics on cancellation (issue #191)
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.
2026-08-05 23:43:28 +00:00
hal9000 304a1ba133 Add cancellation check to grep_search tool
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
2026-08-05 23:39:59 +00:00
hal9000 a64cc3075f issue 190: Add Windows signal handling support
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
2026-08-05 23:33:48 +00:00
darthrubik d2451f3484 Add ctrlc cancel to shell tool 2026-08-05 18:25:53 -05:00
darthrubik 36ebca3f75 When showing editor for -F just always show last thing no matter what 2026-08-05 18:12:28 -05:00
darthrubik 618976e316 Adding the ability to cancel an agent midstream 2026-08-05 18:11:32 -05:00
darthrubik 92d568773c Actually use the saved state 2026-08-04 15:34:16 -05:00
darthrubik 2332daa826 Refactor to make more sense 2026-08-04 15:25:49 -05:00
hal9000 02975ddfd4 Fix: Use helper functions in test_harness_config.sh
- Added dr_config_base_url and dr_config_model helper functions to run_test.sh
- Updated test_harness_config.sh to use be_done() and helper functions instead of inline JSON
2026-08-04 20:20:10 +00:00
hal9000 3e99b37683 Move base_url and model into HarnessConfig (issue 186)
- Added base_url and model fields to HarnessConfig in json_types.hpp
- Removed base_url and model from OllamaConfig in ollama_client.hpp
- Updated OllamaClient constructor to accept base_url and model as separate parameters
- Updated main.cpp to use HarnessConfig for base_url and model
- Updated agent_tool.cpp to use new OllamaClient constructor
- Added test_harness_config.sh to verify the new config fields
- Updated README.md to document the config fields
2026-08-04 15:13:37 -05:00
darthrubik 975069c9d0 Merge pull request 'feature/rebase' (#44) from feature/rebase into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/44
2026-07-23 17:03:55 -05:00
darthrubik 9fe510f00d Removing accidentally commited files 2026-07-23 17:02:35 -05:00
darthrubik 815eeeec44 Rename flag that was used in other branch 2026-07-23 16:59:50 -05:00
darthrubik d655a9d953 Merge remote-tracking branch 'origin/master' into feature/rebase 2026-07-23 16:59:40 -05:00
darthrubik 0e146dbd84 Merge pull request 'Update for build v0.3' (#41) from release/v0.3 into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/41
v0.3
2026-07-22 09:11:22 -05:00
darthrubik e51397d532 Update for build v0.3 2026-07-22 09:10:55 -05:00
darthrubik 709ed403c1 Merge pull request 'Add -P flag to read prompt from file' (#40) from feature/read-from-file into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/40
2026-07-22 09:10:06 -05:00
hal9000 48a3f15999 Add -P flag to read prompt from file
Implement issue 185: Create a new flag -P that reads the prompt from a
file instead of the command line.

Changes:
- Add -P flag parsing in main.cpp
- Read prompt content from specified file
- Update help message
- Update README.md documentation
- Add test_prompt_file.sh with tests for basic, multi-line, and error cases
2026-07-22 14:04:04 +00:00
darthrubik 8a6d69750d Merge pull request 'Updating for release' (#39) from release/v0.2 into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/39
2026-07-10 16:06:29 -05:00
darthrubik 407f23333d Updating for release v0.2 2026-07-10 16:05:28 -05:00
darthrubik eb161931bb Merge pull request 'bugfix/utf8' (#38) from bugfix/utf8 into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/38
2026-07-10 16:02:35 -05:00
hal9000 4b3a277a15 Implement issue 180: Add unit tests for encoding (commit 11484fe)
- Add test_encoding.sh with 11 tests for UTF-8 encoding validation and conversion
- Add -8 debug flag to test ensure_utf8 function with hex-encoded input
- Fix bug in ensure_utf8: check null terminator at loop start to prevent
  undefined behavior when reading past the end of the string
- Tests cover:
  - Valid ASCII passthrough
  - Valid UTF-8 2-byte, 3-byte, and 4-byte sequences
  - Latin-1 byte conversion (0xe9 -> c3a9)
  - Multiple Latin-1 bytes (café)
  - Isolated continuation byte conversion (0x80 -> c280)
  - Mixed valid/invalid bytes
  - Empty string handling
  - Integration test: read_file with non-UTF8 content
2026-07-10 15:50:01 -05:00
darthrubik 11484fec1e Adding the ability to handle non utf8 encodings 2026-07-10 15:29:08 -05:00
darthrubik 8b042a6b4d Merge pull request 'release/v0.1' (#36) from release/v0.1 into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/36
v0.1
2026-07-06 11:34:12 -05:00
darthrubik d6841e1b5d Update for build v0.1 2026-07-06 11:32:53 -05:00
darthrubik bcb0c8fa55 Fixing windows build 2026-07-06 11:32:53 -05:00
darthrubik dd033b24fd Merge pull request 'Handle streaming edge cases' (#35) from bugfix/handle-streaming-edge-case into master
Reviewed-on: https://192.168.8.63/git/darthrubik/drharness/pulls/35
2026-07-06 11:16:00 -05:00
darthrubik 45b17f61b8 Removing accidentally commited code 2026-07-06 11:16:54 -05:00
darthrubik 94b838b8f5 Handle streaming edge cases 2026-06-26 18:14:19 -05:00