mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
Handle partial answers consistently across agent workflows (#51249)
## Why Partial answers contain answer fragments while a turn is still in progress. Treating them as final answers defers mailbox delivery and can count empty fragments as empty final responses; filtering them from forked histories and guardian transcripts loses answer content. ## What changed - Allow mailbox preemption after `partial_answer` messages and keep mailbox delivery open. - Preserve partial answers in forked agent histories and include them as protected assistant entries in guardian transcripts. - Exclude empty partial answers from empty-final-response accounting for goals. ## Testing Add regression coverage for partial-answer phases in live events, sampling continuations, follow-up requests, and forked child requests, plus mailbox preemption, goal accounting, and guardian transcript inclusion. GitOrigin-RevId: 208c8933e211b42b6c2d0bec6952527b8c9c120e
This commit is contained in:
@@ -89,7 +89,10 @@ fn keep_forked_rollout_item(item: &RolloutItem, preserve_context_baselines: bool
|
||||
RolloutItem::ResponseItem(envelope) => match &envelope.item {
|
||||
ResponseItem::Message { role, phase, .. } => match role.as_str() {
|
||||
"system" | "developer" | "user" => true,
|
||||
"assistant" => *phase == Some(MessagePhase::FinalAnswer),
|
||||
"assistant" => matches!(
|
||||
phase,
|
||||
Some(MessagePhase::PartialAnswer | MessagePhase::FinalAnswer)
|
||||
),
|
||||
_ => false,
|
||||
},
|
||||
ResponseItem::FunctionCallOutput { call_id: None, .. }
|
||||
|
||||
Reference in New Issue
Block a user