chore: unify conversation with thread name (#8830)

Done and verified by Codex + refactor feature of RustRover
This commit is contained in:
jif-oai
2026-01-07 17:04:53 +00:00
committed by GitHub
parent 0d788e6263
commit 116059c3a0
83 changed files with 1094 additions and 1203 deletions

View File

@@ -10,7 +10,7 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;
use crate::ConversationId;
use crate::ThreadId;
use crate::approvals::ElicitationRequestEvent;
use crate::config_types::ReasoningSummary as ReasoningSummaryConfig;
use crate::custom_prompts::CustomPrompt;
@@ -80,7 +80,7 @@ pub enum Op {
},
/// Similar to [`Op::UserInput`], but contains additional context required
/// for a turn of a [`crate::codex_conversation::CodexConversation`].
/// for a turn of a [`crate::codex_thread::CodexThread`].
UserTurn {
/// User input items, see `InputItem`
items: Vec<UserInput>,
@@ -738,7 +738,7 @@ pub struct RawResponseItemEvent {
#[derive(Debug, Clone, Deserialize, Serialize, TS, JsonSchema)]
pub struct ItemStartedEvent {
pub thread_id: ConversationId,
pub thread_id: ThreadId,
pub turn_id: String,
pub item: TurnItem,
}
@@ -756,7 +756,7 @@ impl HasLegacyEvent for ItemStartedEvent {
#[derive(Debug, Clone, Deserialize, Serialize, TS, JsonSchema)]
pub struct ItemCompletedEvent {
pub thread_id: ConversationId,
pub thread_id: ThreadId,
pub turn_id: String,
pub item: TurnItem,
}
@@ -1180,17 +1180,18 @@ pub struct WebSearchEndEvent {
pub query: String,
}
// Conversation kept for backward compatibility.
/// Response payload for `Op::GetHistory` containing the current session's
/// in-memory transcript.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct ConversationPathResponseEvent {
pub conversation_id: ConversationId,
pub conversation_id: ThreadId,
pub path: PathBuf,
}
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct ResumedHistory {
pub conversation_id: ConversationId,
pub conversation_id: ThreadId,
pub history: Vec<RolloutItem>,
pub rollout_path: PathBuf,
}
@@ -1285,7 +1286,7 @@ impl fmt::Display for SubAgentSource {
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, TS)]
pub struct SessionMeta {
pub id: ConversationId,
pub id: ThreadId,
pub timestamp: String,
pub cwd: PathBuf,
pub originator: String,
@@ -1299,7 +1300,7 @@ pub struct SessionMeta {
impl Default for SessionMeta {
fn default() -> Self {
SessionMeta {
id: ConversationId::default(),
id: ThreadId::default(),
timestamp: String::new(),
cwd: PathBuf::new(),
originator: String::new(),
@@ -1811,8 +1812,8 @@ pub struct SkillsListEntry {
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct SessionConfiguredEvent {
/// Name left as session_id instead of conversation_id for backwards compatibility.
pub session_id: ConversationId,
/// Name left as session_id instead of thread_id for backwards compatibility.
pub session_id: ThreadId,
/// Tell the client what model is being queried.
pub model: String,
@@ -1940,7 +1941,7 @@ mod tests {
#[test]
fn item_started_event_from_web_search_emits_begin_event() {
let event = ItemStartedEvent {
thread_id: ConversationId::new(),
thread_id: ThreadId::new(),
turn_id: "turn-1".into(),
item: TurnItem::WebSearch(WebSearchItem {
id: "search-1".into(),
@@ -1959,7 +1960,7 @@ mod tests {
#[test]
fn item_started_event_from_non_web_search_emits_no_legacy_events() {
let event = ItemStartedEvent {
thread_id: ConversationId::new(),
thread_id: ThreadId::new(),
turn_id: "turn-1".into(),
item: TurnItem::UserMessage(UserMessageItem::new(&[])),
};
@@ -2027,7 +2028,7 @@ mod tests {
/// amount of nesting.
#[test]
fn serialize_event() -> Result<()> {
let conversation_id = ConversationId::from_string("67e55044-10b1-426f-9247-bb680e5fe0c8")?;
let conversation_id = ThreadId::from_string("67e55044-10b1-426f-9247-bb680e5fe0c8")?;
let rollout_file = NamedTempFile::new()?;
let event = Event {
id: "1234".to_string(),