Avoid double truncation (#6631)

1. Avoid double truncation by giving 10% above the tool default constant
2. Add tests that fails when const = 1
This commit is contained in:
Ahmed Ibrahim authored and GitHub committed 2025-11-13 16:59:31 -08:00
1 parent 7b027e7536
commit 9890ceb939
7 files changed
+264 -35

No files matched your search

+3 -1
View File
@@ -9,6 +9,8 @@ pub mod runtimes;
pub mod sandboxing;
pub mod spec;
use crate::context_manager::MODEL_FORMAT_MAX_BYTES;
use crate::context_manager::MODEL_FORMAT_MAX_LINES;
use crate::context_manager::format_output_for_model_body;
use crate::exec::ExecToolCallOutput;
pub use router::ToolRouter;
@@ -75,5 +77,5 @@ pub fn format_exec_output_str(exec_output: &ExecToolCallOutput) -> String {
};
// Truncate for model consumption before serialization.
format_output_for_model_body(&body)
format_output_for_model_body(&body, MODEL_FORMAT_MAX_BYTES, MODEL_FORMAT_MAX_LINES)
}