mirror of
https://github.com/openai/codex.git
synced 2026-11-03 16:23:51 +00:00
Run compact session-start hooks before turn continuation (#34396)
## Why Mid-turn auto-compaction queued `SessionStart` hooks but continued sampling before running them. This delayed hook-provided context and ignored requests to stop the continuation. ## What changed Drain pending session-start hooks immediately after successful mid-turn auto-compaction. End the turn when a hook requests a stop; otherwise include its additional context in the next sampling request. ## Testing Added coverage for repeated compactions in one turn, context delivery without leaking hooks into the next user turn, and stop requests that block sampling. GitOrigin-RevId: c57708a792fb47d98d95c38d7d91bcd9f235be84
This commit is contained in:
1 parent
e4836f998d
commit
8c41ed33ce
2 files changed
+274
No files matched your search
@@ -371,6 +371,9 @@ pub(crate) async fn run_turn(
|
||||
.await;
|
||||
return Ok(None);
|
||||
}
|
||||
if run_pending_session_start_hooks(&sess, &turn_context).await {
|
||||
return Ok(None);
|
||||
}
|
||||
can_drain_pending_input = !model_needs_follow_up;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user