Files
codex/codex-rs/protocol/src/lib.rs
T
Ruslan Nigmatullin d84c872464 Route response item IDs through a shared generator (#59312)
## What changed

Introduce `ItemIdGenerator` and pass the runtime-owned generator through sessions, model clients, history, hooks, tool outputs, and memory requests. Keep UUIDv7 generation as the default and replace direct calls to `ResponseItemId::new` with the shared callable.

Preserve existing item IDs and backfill missing or empty IDs through the same generator, including forked history before reconstruction and persistence.

## Testing

Extend coverage for UUIDv7 IDs on user messages, agent messages, and additional tools, and assert that forked model context matches the backfilled items persisted to history.

GitOrigin-RevId: 0dd9ccf0f46f0f1005a6acfc740133b03ce82259
2026-11-04 04:02:00 +00:00

64 lines
1.6 KiB
Rust

pub mod account;
mod agent_path;
pub mod auth;
mod item_id_generator;
mod response_item_id;
mod response_usage;
mod sanitized_git_url;
mod session_id;
mod thread_id;
mod tool_name;
pub use agent_path::AgentPath;
pub use item_id_generator::ItemIdGenerator;
#[cfg(test)]
use item_id_generator::uuid_v7_item_id_generator_for_test;
pub use permission_profile_intersection::PermissionIntersectionError;
pub use permission_profile_intersection::intersect_effective_permission_profiles;
pub use response_item_id::ResponseItemId;
pub use response_usage::ResponseUsageMetadata;
pub use sanitized_git_url::SanitizedGitUrl;
pub use session_id::SessionId;
pub use thread_id::RolloutId;
pub use thread_id::ThreadId;
pub use tool_name::DEFAULT_FUNCTION_NAMESPACE;
pub use tool_name::ToolName;
pub mod approvals;
pub mod capabilities;
mod codex_error_info;
pub mod config_types;
mod guardian_transcript;
pub use guardian_transcript::TranscriptFormat;
pub mod dynamic_tools;
mod environment;
pub mod error;
pub mod exec_output;
pub mod hooks;
pub mod items;
mod legacy_events;
pub mod local_media;
pub mod mcp;
pub mod mcp_approval_meta;
pub mod mcp_policy;
pub mod memory_citation;
mod memory_version;
pub use memory_version::MemoryVersion;
pub mod models;
pub mod network_policy;
pub mod num_format;
pub mod openai_models;
pub mod parse_command;
mod permission_profile_intersection;
mod permission_profile_snapshot;
pub mod permissions;
pub mod plan_tool;
pub mod protocol;
pub mod realtime;
pub mod request_permissions;
pub mod request_user_input;
pub mod review_format;
pub mod sandbox;
pub mod security_risk;
pub mod shell_environment;
pub mod turn_input;
pub mod user_input;