diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index d23ef3bf56..209c184c8c 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -252,7 +252,7 @@ pub struct FeedbackUploadResponse { // Thread APIs -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema, TS)] #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] pub struct ThreadStartParams { @@ -280,7 +280,7 @@ pub struct ThreadStartResponse { #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] pub struct ThreadResumeParams { - pub thread: Thread, + pub thread_id: String, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] @@ -294,7 +294,7 @@ pub struct ThreadResumeResponse { #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] pub struct ThreadArchiveParams { - pub thread: Thread, + pub thread_id: String, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] diff --git a/codex-rs/app-server/src/codex_message_processor.rs b/codex-rs/app-server/src/codex_message_processor.rs index fd2f4069cc..d0b558266e 100644 --- a/codex-rs/app-server/src/codex_message_processor.rs +++ b/codex-rs/app-server/src/codex_message_processor.rs @@ -1050,7 +1050,7 @@ impl CodexMessageProcessor { async fn thread_archive(&self, request_id: RequestId, params: ThreadArchiveParams) { // Resolve conversation id from v2 thread id string. - let conversation_id = match ConversationId::from_string(¶ms.thread.id) { + let conversation_id = match ConversationId::from_string(¶ms.thread_id) { Ok(id) => id, Err(err) => { let error = JSONRPCErrorError { @@ -1307,7 +1307,7 @@ impl CodexMessageProcessor { async fn thread_resume(&self, request_id: RequestId, params: ThreadResumeParams) { // Convert thread id string into ConversationId. - let conversation_id = match ConversationId::from_string(¶ms.thread.id) { + let conversation_id = match ConversationId::from_string(¶ms.thread_id) { Ok(id) => id, Err(err) => { let error = JSONRPCErrorError { diff --git a/codex-rs/app-server/tests/suite/v2/thread_archive.rs b/codex-rs/app-server/tests/suite/v2/thread_archive.rs index eb65f4419c..345580ca32 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_archive.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_archive.rs @@ -51,7 +51,7 @@ async fn thread_archive_moves_rollout_into_archived_directory() -> Result<()> { // Archive the thread. let archive_id = mcp .send_thread_archive_request(ThreadArchiveParams { - thread: thread.clone(), + thread_id: thread.id.clone(), }) .await?; let archive_resp: JSONRPCResponse = timeout( diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs index c503d8138e..bde3f8d982 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs @@ -39,7 +39,7 @@ async fn thread_resume_returns_existing_thread() -> Result<()> { // Resume it via v2 API. let resume_id = mcp .send_thread_resume_request(ThreadResumeParams { - thread: thread.clone(), + thread_id: thread.id.clone(), }) .await?; let resume_resp: JSONRPCResponse = timeout(