thread/list and thread/resume

This commit is contained in:
Owen Lin
2025-11-02 12:01:19 -08:00
parent e249fcdc1d
commit 6fbb3665a2
5 changed files with 488 additions and 12 deletions

View File

@@ -32,6 +32,8 @@ use codex_app_server_protocol::SendUserTurnParams;
use codex_app_server_protocol::ServerRequest;
use codex_app_server_protocol::SetDefaultModelParams;
use codex_app_server_protocol::ThreadArchiveParams;
use codex_app_server_protocol::ThreadListParams;
use codex_app_server_protocol::ThreadResumeParams;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::JSONRPCError;
@@ -327,6 +329,24 @@ impl McpProcess {
self.send_request("thread/archive", params).await
}
/// Send a `thread/list` JSON-RPC request (v2).
pub async fn send_thread_list_request(
&mut self,
params: ThreadListParams,
) -> anyhow::Result<i64> {
let params = Some(serde_json::to_value(params)?);
self.send_request("thread/list", params).await
}
/// Send a `thread/resume` JSON-RPC request (v2).
pub async fn send_thread_resume_request(
&mut self,
params: ThreadResumeParams,
) -> anyhow::Result<i64> {
let params = Some(serde_json::to_value(params)?);
self.send_request("thread/resume", params).await
}
/// Send a `cancelLoginChatGpt` JSON-RPC request.
pub async fn send_cancel_login_chat_gpt_request(
&mut self,