mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Preserve steering when returning to a long-running turn (#58998)
## Why Switching back to a running thread can lose the active turn's state after its `TurnStarted` notification falls out of the bounded replay buffer, breaking steering. ## What changed Retain the evicted active turn and include it in replay snapshots when it is missing from the stored turns. Clear the retained turn when turns are replaced, the active turn completes, or the thread closes. ## Testing Add a regression test that evicts the turn-start notification, restores the thread, and submits two steering messages while preserving a queued follow-up. A snapshot verifies the steering messages and queued input remain visible. GitOrigin-RevId: a4302a2e0990b907207c229361cbcec68ebbbdc4
This commit is contained in:
committed by
copyberry
parent
dd2df0aa9d
commit
adca203576
@@ -64,6 +64,10 @@ impl ThreadEventStore {
|
||||
self.buffered_agent_message_delta_bytes = self
|
||||
.buffered_agent_message_delta_bytes
|
||||
.saturating_sub(delta.delta.len());
|
||||
} else if let ServerNotification::TurnStarted(started) = *notification
|
||||
&& self.active_turn_id() == Some(&started.turn.id)
|
||||
{
|
||||
self.evicted_active_turn = Some(Box::new(started.turn));
|
||||
}
|
||||
}
|
||||
ThreadBufferedEvent::Request(request) => self
|
||||
|
||||
Reference in New Issue
Block a user