mirror of
https://github.com/openai/codex.git
synced 2026-11-21 15:10:25 +00:00
Require prefixes for outbound response item IDs (#32312)
## What changed - Add a `ResponseItemId` type that generates item-specific prefixes with UUIDv7 suffixes and use it across response items. - Keep deserialization permissive for legacy histories, but omit empty or unprefixed item IDs from HTTP and WebSocket requests. - Export the new type in the generated TypeScript protocol schema. ## Testing - Cover prefixed ID generation, legacy deserialization, prefix recognition, and outbound request filtering. GitOrigin-RevId: 0209fe430c826d0ae88bc4648652c4ebf390c4a4
This commit is contained in:
1 parent
08ba14b03d
commit
c9d52de5ca
38 files changed
+430
-160
No files matched your search
@@ -7,6 +7,7 @@ use codex_core::context::extension_image_generation_output_hint;
|
||||
use codex_extension_api::ToolOutput;
|
||||
use codex_extension_api::ToolPayload;
|
||||
use codex_extension_api::ToolSpec;
|
||||
use codex_protocol::ResponseItemId;
|
||||
use codex_protocol::models::ContentItem;
|
||||
use codex_protocol::models::DEFAULT_IMAGE_DETAIL;
|
||||
use codex_protocol::models::FunctionCallOutputBody;
|
||||
@@ -109,7 +110,7 @@ async fn recent_image_fallback_selects_newest_images_in_chronological_order() {
|
||||
internal_chat_message_metadata_passthrough: None,
|
||||
},
|
||||
ResponseItem::ImageGenerationCall {
|
||||
id: Some("generated-call".to_string()),
|
||||
id: Some(ResponseItemId::with_suffix("ig", "generated-call")),
|
||||
status: "completed".to_string(),
|
||||
revised_prompt: None,
|
||||
result: "generated".to_string(),
|
||||
|
||||
Reference in new issue
Block a user