From e92627bf7e5f1aa87254b8eedc4a2d19f614452a Mon Sep 17 00:00:00 2001 From: Benjamin Carlsson Date: Mon, 17 Aug 2026 20:25:38 +0000 Subject: [PATCH] Build filesystem JSON params only for remote TUI sessions (#39077) ## Why In-process app-server filesystem requests use typed protocol requests and do not need JSON-RPC parameters. ## What changed Pass remote filesystem parameters to `request_fs_path` as closures and evaluate them only when the session uses a remote request handle. GitOrigin-RevId: 623c8733542553d73e2c0e4c4a60d40258bc91c1 --- codex-rs/tui/src/app_server_session/fs.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/codex-rs/tui/src/app_server_session/fs.rs b/codex-rs/tui/src/app_server_session/fs.rs index 9a15f2585d..74d0e075ef 100644 --- a/codex-rs/tui/src/app_server_session/fs.rs +++ b/codex-rs/tui/src/app_server_session/fs.rs @@ -35,7 +35,7 @@ impl AppServerSession { recursive: Some(true), }, }, - json!({ "path": path.as_str(), "recursive": true }), + || json!({ "path": path.as_str(), "recursive": true }), ) .await .map(drop) @@ -57,7 +57,7 @@ impl AppServerSession { data_base64: data_base64.clone(), }, }, - json!({ "path": path.as_str(), "dataBase64": data_base64 }), + || json!({ "path": path.as_str(), "dataBase64": data_base64 }), ) .await .map(drop) @@ -72,7 +72,7 @@ impl AppServerSession { request_id, params: FsReadFileParams { path }, }, - json!({ "path": path.as_str() }), + || json!({ "path": path.as_str() }), ) .await?; STANDARD @@ -92,7 +92,7 @@ impl AppServerSession { force: None, }, }, - json!({ "path": path.as_str() }), + || json!({ "path": path.as_str() }), ) .await .map(drop) @@ -103,7 +103,7 @@ impl AppServerSession { method: &str, path: &AppServerPath, local_request: impl FnOnce(RequestId, AbsolutePathBuf) -> ClientRequest, - remote_params: serde_json::Value, + remote_params: impl FnOnce() -> serde_json::Value, ) -> Result { let request_id = self.next_request_id(); match self.request_handle() { @@ -112,7 +112,7 @@ impl AppServerSession { .request_json_rpc(JSONRPCRequest { id: request_id, method: method.to_string(), - params: Some(remote_params), + params: Some(remote_params()), trace: None, }) .await