mirror of
https://github.com/openai/codex.git
synced 2026-12-03 07:47:10 +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
@@ -1,6 +1,7 @@
|
||||
use super::*;
|
||||
use codex_extension_api::ExtensionData;
|
||||
use codex_extension_api::TurnItemContributor;
|
||||
use codex_protocol::ResponseItemId;
|
||||
use codex_protocol::items::AgentMessageContent;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::sync::Arc;
|
||||
@@ -27,7 +28,7 @@ impl TurnItemContributor for RewriteAgentMessageContributor {
|
||||
|
||||
fn assistant_output_text(text: &str) -> ResponseItem {
|
||||
ResponseItem::Message {
|
||||
id: Some("msg-1".to_string()),
|
||||
id: Some(ResponseItemId::with_suffix("msg", "1")),
|
||||
role: "assistant".to_string(),
|
||||
content: vec![ContentItem::OutputText {
|
||||
text: text.to_string(),
|
||||
|
||||
Reference in new issue
Block a user