chore: compact do not modify instructions (#4088)

Keep the developer instruction and insert the summarisation message as a
user message instead
This commit is contained in:
jif-oai
2025-09-23 17:59:17 +01:00
committed by GitHub
parent 6cd5309d91
commit b84a920067
4 changed files with 81 additions and 69 deletions

View File

@@ -1117,16 +1117,13 @@ impl AgentTask {
turn_context: Arc<TurnContext>,
sub_id: String,
input: Vec<InputItem>,
compact_instructions: String,
) -> Self {
let handle = {
let sess = sess.clone();
let sub_id = sub_id.clone();
let tc = Arc::clone(&turn_context);
tokio::spawn(async move {
compact::run_compact_task(sess, tc, sub_id, input, compact_instructions).await
})
.abort_handle()
tokio::spawn(async move { compact::run_compact_task(sess, tc, sub_id, input).await })
.abort_handle()
};
Self {
sess,
@@ -1434,7 +1431,7 @@ async fn submission_loop(
// Attempt to inject input into current task
if let Err(items) = sess
.inject_input(vec![InputItem::Text {
text: compact::COMPACT_TRIGGER_TEXT.to_string(),
text: compact::SUMMARIZATION_PROMPT.to_string(),
}])
.await
{