Files
drharness/tests/test_rebase_apply_edit_preserves_tool_calls.sh
darthrubik d81c75a9a3 Fix issue 134: add_message_field no longer accepts raw JSON for tool_calls
The add_message_field function now constructs tool call JSON internally
from simple parameters (id, name, arguments) instead of accepting raw
JSON strings. This makes the test helper functions more robust and
easier to use.

Changed:
- add_message_field: tool_call field now takes id, name, args and builds JSON
- create_message_json: updated to handle tool_call's 3-parameter syntax
- create_messages_json: updated to handle tool_call's 3-parameter syntax
- is_message_field: changed tool_calls to tool_call
- Updated all test files that used the old tool_calls raw JSON syntax
2026-06-03 07:53:39 -05:00

17 lines
537 B
Bash
Executable File

#!/bin/bash
# test_rebase_apply_edit_preserves_tool_calls.sh - tool_calls field preserved during edit
lines=$(create_rebase_lines edit 0 assistant)
history=$(create_messages_json assistant "calling tool" tool_call "call_1" "test" "{}")
OUTPUT=$("${DRHARNESS}" -A "$lines" "$history")
# tool_calls should be preserved
if ! echo "$OUTPUT" | grep -q '"tool_calls"'; then
echo "FAIL: edit_preserves_tool_calls - tool_calls should be preserved during edit"
echo "Got: $OUTPUT"
exit 1
fi
echo "PASS: edit_preserves_tool_calls"