some cleanup

This commit is contained in:
Dhanji Prasanna
2025-10-15 11:12:26 +11:00
parent fb64b7fe32
commit 793fc544c0
12 changed files with 27 additions and 1957 deletions

View File

@@ -8,23 +8,9 @@ pub use task_result::TaskResult;
mod task_result_comprehensive_tests;
use crate::ui_writer::UiWriter;
#[cfg(test)]
mod filter_json_tests;
mod new_filter_json;
mod correct_filter_json;
#[cfg(test)]
mod comprehensive_filter_tests;
mod fixed_filter_json;
#[cfg(test)]
mod fixed_filter_tests;
mod final_filter_json;
#[cfg(test)]
mod final_filter_tests;
#[cfg(test)]
mod final_corrected_tests;
#[cfg(test)]
mod error_handling_test;
@@ -1433,7 +1419,7 @@ The tool will execute immediately and you'll receive the result (success or erro
.replace("<</SYS>>", "");
// Filter out JSON tool calls from the display
let filtered_content = final_filter_json::final_filter_json_tool_calls(&clean_content);
let filtered_content = fixed_filter_json::fixed_filter_json_tool_calls(&clean_content);
let final_display_content = filtered_content.trim();
// Display any new content before tool execution
@@ -1664,7 +1650,7 @@ The tool will execute immediately and you'll receive the result (success or erro
.replace("<</SYS>>", "");
if !clean_content.is_empty() {
let filtered_content = final_filter_json::final_filter_json_tool_calls(&clean_content);
let filtered_content = fixed_filter_json::fixed_filter_json_tool_calls(&clean_content);
if !filtered_content.is_empty() {
if !response_started {
@@ -1707,7 +1693,8 @@ The tool will execute immediately and you'll receive the result (success or erro
.replace("</s>", "")
.replace("[/INST]", "")
.replace("<</SYS>>", "");
let filtered_text = final_filter_json::final_filter_json_tool_calls(&clean_text);
let filtered_text = fixed_filter_json::fixed_filter_json_tool_calls(&clean_text);
// Only use this if we truly have nothing else
if !filtered_text.trim().is_empty() && full_response.is_empty()
@@ -2391,12 +2378,7 @@ The tool will execute immediately and you'll receive the result (success or erro
}
}
// Helper function to filter JSON tool calls from display content (unused)
#[allow(dead_code)]
fn filter_json_tool_calls(content: &str) -> String {
// This function is no longer used - replaced by final_filter_json::final_filter_json_tool_calls
content.to_string()
}
// Note: JSON tool call filtering is now handled by fixed_filter_json::fixed_filter_json_tool_calls
// Apply unified diff to an input string with optional [start, end) bounds
pub fn apply_unified_diff_to_string(