mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +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
@@ -447,7 +447,7 @@ impl ThreadHistoryBuilder {
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(hook_prompt) = parse_hook_prompt_message(id.as_ref(), content) else {
|
||||
let Some(hook_prompt) = parse_hook_prompt_message(id.as_deref(), content) else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -4113,7 +4113,7 @@ mod tests {
|
||||
collaboration_mode_kind: Default::default(),
|
||||
})),
|
||||
RolloutItem::ResponseItem(codex_protocol::models::ResponseItem::Message {
|
||||
id: Some("msg-1".into()),
|
||||
id: Some(codex_protocol::ResponseItemId::with_suffix("msg", "1")),
|
||||
role: "user".into(),
|
||||
content: vec![codex_protocol::models::ContentItem::InputText {
|
||||
text: "plain text".into(),
|
||||
|
||||
Reference in new issue
Block a user