mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Rewrite oversized tool outputs during remote compaction (#26251)
## Why When trying to fit history under compaction limit rewrite output items instead of removing them entirely. Otherwise we're breaking incrementality in relation to the previous response.
This commit is contained in:
committed by
GitHub
Unverified
parent
11bceb8f8b
commit
4231472c03
@@ -185,16 +185,16 @@ async fn run_remote_compact_task_inner_impl(
|
||||
|
||||
let mut history = sess.clone_history().await;
|
||||
let base_instructions = sess.get_base_instructions().await;
|
||||
let deleted_items = trim_function_call_history_to_fit_context_window(
|
||||
let rewritten_outputs = trim_function_call_history_to_fit_context_window(
|
||||
&mut history,
|
||||
turn_context.as_ref(),
|
||||
&base_instructions,
|
||||
);
|
||||
if deleted_items > 0 {
|
||||
if rewritten_outputs > 0 {
|
||||
info!(
|
||||
turn_id = %turn_context.sub_id,
|
||||
deleted_items,
|
||||
"trimmed history items before remote compaction v2"
|
||||
rewritten_outputs,
|
||||
"rewrote history outputs before remote compaction v2"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user