Skip to content

chore(protocol): use UUIDv7 for generated item IDs#31524

Merged
owenlin0 merged 2 commits into
mainfrom
owen/uuidv7-generated-item-ids
Jul 8, 2026
Merged

chore(protocol): use UUIDv7 for generated item IDs#31524
owenlin0 merged 2 commits into
mainfrom
owen/uuidv7-generated-item-ids

Conversation

@owenlin0

@owenlin0 owenlin0 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Use UUIDv7 for item IDs generated locally in codex-protocol.

This covers user messages, agent messages, hook prompts, and context compaction items. These IDs are generated once and carried through item lifecycle, so this only changes the UUID version. It keeps generated item IDs consistent with thread and turn IDs.

Comment thread codex-rs/protocol/src/items.rs Outdated
pub fn new(content: &[UserInput]) -> Self {
Self {
id: uuid::Uuid::new_v4().to_string(),
id: uuid::Uuid::now_v7().to_string(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: fn new_item_id() ?

@owenlin0 owenlin0 enabled auto-merge (squash) July 8, 2026 18:21
@owenlin0 owenlin0 merged commit 154433c into main Jul 8, 2026
35 checks passed
@owenlin0 owenlin0 deleted the owen/uuidv7-generated-item-ids branch July 8, 2026 18:35
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants