rename update apply RPC to install

This commit is contained in:
Will Wang
2026-06-23 12:21:33 -07:00
parent 0c1ec916ce
commit f0e0092d80
14 changed files with 42 additions and 42 deletions
+3 -3
View File
@@ -6097,9 +6097,9 @@
},
"method": {
"enum": [
"update/apply"
"update/install"
],
"title": "Update/applyRequestMethod",
"title": "Update/installRequestMethod",
"type": "string"
},
"params": {
@@ -6110,7 +6110,7 @@
"id",
"method"
],
"title": "Update/applyRequest",
"title": "Update/installRequest",
"type": "object"
},
{
@@ -1555,9 +1555,9 @@
},
"method": {
"enum": [
"update/apply"
"update/install"
],
"title": "Update/applyRequestMethod",
"title": "Update/installRequestMethod",
"type": "string"
},
"params": {
@@ -1568,7 +1568,7 @@
"id",
"method"
],
"title": "Update/applyRequest",
"title": "Update/installRequest",
"type": "object"
},
{
@@ -20224,11 +20224,6 @@
],
"type": "object"
},
"UpdateApplyResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateApplyResponse",
"type": "object"
},
"UpdateCheckResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -20254,6 +20249,11 @@
"title": "UpdateCheckResponse",
"type": "object"
},
"UpdateInstallResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateInstallResponse",
"type": "object"
},
"UserInput": {
"oneOf": [
{
@@ -2566,9 +2566,9 @@
},
"method": {
"enum": [
"update/apply"
"update/install"
],
"title": "Update/applyRequestMethod",
"title": "Update/installRequestMethod",
"type": "string"
},
"params": {
@@ -2579,7 +2579,7 @@
"id",
"method"
],
"title": "Update/applyRequest",
"title": "Update/installRequest",
"type": "object"
},
{
@@ -18003,11 +18003,6 @@
],
"type": "object"
},
"UpdateApplyResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateApplyResponse",
"type": "object"
},
"UpdateCheckResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
@@ -18033,6 +18028,11 @@
"title": "UpdateCheckResponse",
"type": "object"
},
"UpdateInstallResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateInstallResponse",
"type": "object"
},
"UserInput": {
"oneOf": [
{
@@ -1,5 +1,5 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "UpdateApplyResponse",
"title": "UpdateInstallResponse",
"type": "object"
}
File diff suppressed because one or more lines are too long
@@ -2,4 +2,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type UpdateApplyResponse = Record<string, never>;
export type UpdateInstallResponse = Record<string, never>;
+1 -1
View File
@@ -487,8 +487,8 @@ export type { TurnStatus } from "./TurnStatus";
export type { TurnSteerParams } from "./TurnSteerParams";
export type { TurnSteerResponse } from "./TurnSteerResponse";
export type { TurnsPage } from "./TurnsPage";
export type { UpdateApplyResponse } from "./UpdateApplyResponse";
export type { UpdateCheckResponse } from "./UpdateCheckResponse";
export type { UpdateInstallResponse } from "./UpdateInstallResponse";
export type { UserInput } from "./UserInput";
export type { WarningNotification } from "./WarningNotification";
export type { WebSearchAction } from "./WebSearchAction";
@@ -870,10 +870,10 @@ client_request_definitions! {
serialization: global("update"),
response: v2::UpdateCheckResponse,
},
UpdateApply => "update/apply" {
UpdateInstall => "update/install" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: global("update"),
response: v2::UpdateApplyResponse,
response: v2::UpdateInstallResponse,
},
ExperimentalFeatureList => "experimentalFeature/list" {
params: v2::ExperimentalFeatureListParams,
@@ -28,4 +28,4 @@ pub struct UpdateCheckResponse {
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct UpdateApplyResponse {}
pub struct UpdateInstallResponse {}
+4 -4
View File
@@ -202,7 +202,7 @@ Example with notification opt-out:
- `model/list` — list available models (set `includeHidden: true` to include entries with `hidden: true`), with model-advertised string reasoning effort options in the catalog's intended progression order, `additionalSpeedTiers`, `serviceTiers`, optional `defaultServiceTier`, optional legacy `upgrade` model ids, optional `upgradeInfo` metadata (`model`, `upgradeCopy`, `modelLink`, `migrationMarkdown`), and optional `availabilityNux` metadata. Clients should preserve the `supportedReasoningEfforts` array order rather than deriving order from the effort names.
- `modelProvider/capabilities/read` — read provider-level capabilities for the currently configured model provider.
- `update/check` — force a fresh update check and return the current version, latest version available through the detected distribution channel, installation method, and whether app-server can apply the update automatically.
- `update/apply` — run the updater associated with the detected installation method; returns `{}` after the updater exits successfully.
- `update/install` — run the updater associated with the detected installation method; returns `{}` after the updater exits successfully.
- `experimentalFeature/list` — list feature flags with stage metadata (`beta`, `underDevelopment`, `stable`, etc.), enabled/default-enabled state, and cursor pagination. Pass `threadId` when showing feature state for an existing loaded thread so `enabled` is computed from that thread's refreshed config, including project-local config for the thread's cwd; if omitted, the server uses its default config resolution context. For non-beta flags, `displayName`/`description`/`announcement` are `null`.
- `permissionProfile/list` — beta; list available permission profile ids with optional display `description` text and an `allowed` flag reflecting effective requirements, using cursor pagination. Pass `cwd` when the caller needs project-local `[permissions.<id>]` entries to be included in the current catalog view.
- `experimentalFeature/enablement/set` — patch the in-memory process-wide runtime feature enablement for currently supported feature keys. For each feature, precedence is: cloud requirements > --enable <feature_name> > config.toml > experimentalFeature/enablement/set (new) > code default. Invalid keys will be ignored.
@@ -1922,18 +1922,18 @@ request has no params:
release to be ready under npm's `latest` tag. Homebrew checks the cask version;
standalone and other installations check the latest GitHub release.
When `canAutoUpdate` is `true`, call `update/apply` to run the
When `canAutoUpdate` is `true`, call `update/install` to run the
corresponding npm, Bun, Homebrew, or standalone installer. The updater's output
is not written to the JSON-RPC transport. A successful response means the
installer exited with a zero status; restart app-server to run the newly
installed version.
```json
{ "method": "update/apply", "id": 51 }
{ "method": "update/install", "id": 51 }
{ "id": 51, "result": {} }
```
For `installationMethod: "other"`, `update/apply` returns an invalid-request
For `installationMethod: "other"`, `update/install` returns an invalid-request
error because app-server cannot determine a safe updater command.
## Auth endpoints
+1 -1
View File
@@ -1091,7 +1091,7 @@ impl MessageProcessor {
.await
.map(|response| Some(response.into())),
ClientRequest::UpdateCheck { params: _, .. } => self.update_processor.check().await,
ClientRequest::UpdateApply { params: _, .. } => self.update_processor.apply().await,
ClientRequest::UpdateInstall { params: _, .. } => self.update_processor.install().await,
ClientRequest::ThreadStart { params, .. } => {
self.thread_processor
.thread_start(
@@ -3,8 +3,8 @@ use crate::error_code::invalid_request;
use codex_app_server_protocol::ClientResponsePayload;
use codex_app_server_protocol::InstallationMethod;
use codex_app_server_protocol::JSONRPCErrorError;
use codex_app_server_protocol::UpdateApplyResponse;
use codex_app_server_protocol::UpdateCheckResponse;
use codex_app_server_protocol::UpdateInstallResponse;
use codex_install_context::InstallContext;
use codex_install_context::InstallMethod;
use codex_install_context::StandalonePlatform;
@@ -35,7 +35,7 @@ impl UpdateRequestProcessor {
))
}
pub(crate) async fn apply(&self) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
pub(crate) async fn install(&self) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
let Some(action) = codex_update::get_update_action() else {
return Err(invalid_request(
"automatic updates are unavailable for this Codex installation",
@@ -79,7 +79,7 @@ impl UpdateRequestProcessor {
)));
}
Ok(Some(UpdateApplyResponse {}.into()))
Ok(Some(UpdateInstallResponse {}.into()))
}
}
@@ -635,9 +635,9 @@ impl TestAppServer {
self.send_request("update/check", /*params*/ None).await
}
/// Send an `update/apply` JSON-RPC request.
pub async fn send_update_apply_request(&mut self) -> anyhow::Result<i64> {
self.send_request("update/apply", /*params*/ None).await
/// Send an `update/install` JSON-RPC request.
pub async fn send_update_install_request(&mut self) -> anyhow::Result<i64> {
self.send_request("update/install", /*params*/ None).await
}
/// Send an `experimentalFeature/list` JSON-RPC request.
+5 -5
View File
@@ -5,7 +5,7 @@ use app_test_support::TestAppServer;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::UpdateApplyResponse;
use codex_app_server_protocol::UpdateInstallResponse;
use pretty_assertions::assert_eq;
use std::fs;
use std::os::unix::fs::PermissionsExt;
@@ -16,7 +16,7 @@ use tokio::time::timeout;
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
#[tokio::test]
async fn update_apply_runs_the_detected_npm_updater() -> Result<()> {
async fn update_install_runs_the_detected_npm_updater() -> Result<()> {
let codex_home = TempDir::new()?;
let bin_dir = codex_home.path().join("bin");
fs::create_dir_all(&bin_dir)?;
@@ -47,15 +47,15 @@ async fn update_apply_runs_the_detected_npm_updater() -> Result<()> {
.await?;
timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??;
let request_id = mcp.send_update_apply_request().await?;
let request_id = mcp.send_update_install_request().await?;
let response: JSONRPCResponse = timeout(
DEFAULT_TIMEOUT,
mcp.read_stream_until_response_message(RequestId::Integer(request_id)),
)
.await??;
let response = to_response::<UpdateApplyResponse>(response)?;
let response = to_response::<UpdateInstallResponse>(response)?;
assert_eq!(response, UpdateApplyResponse {});
assert_eq!(response, UpdateInstallResponse {});
assert_eq!(
fs::read_to_string(invocation_path)?,
"install\n-g\n@openai/codex\n"