mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Normalize Bedrock Mantle commentary before replay (#62095)
## Why Bedrock Mantle's reasoning prefix omits empty `annotations` on assistant commentary. Replayed commentary needs to preserve that form to keep the prefix stable. ## What changed Add a provider hook to normalize completed output items before they enter model history. For Mantle, omit empty `annotations` from assistant commentary text while preserving nonempty annotations, final answers, and Bedrock Runtime output. ## Testing Add regression coverage for Mantle and Runtime that checks commentary replay across a tool continuation and a subsequent turn, including reasoning and tool item ordering and preservation of final-answer content. GitOrigin-RevId: ecd5b9b5dca8c24956a6379c9d0fb643e4427af3
This commit is contained in:
@@ -2962,6 +2962,7 @@ where
|
||||
};
|
||||
let event = match event {
|
||||
Ok(ResponseEvent::OutputItemDone(mut item)) => {
|
||||
provider.normalize_completed_output_item(&mut item);
|
||||
// Assign IDs after interceptors, which may replace provider items.
|
||||
// Reuse the added event's ID so tracing and the harness agree.
|
||||
if item.id().is_none_or(|id| id.is_empty()) {
|
||||
|
||||
Reference in New Issue
Block a user