From e162f96b785bf1184179b4a8b7d56148ce1f0d58 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Wed, 28 Jan 2026 20:24:14 -0800 Subject: [PATCH] More aliasing --- codex-rs/app-server-protocol/src/protocol/common.rs | 13 ++++++++++--- codex-rs/app-server/README.md | 2 +- codex-rs/protocol/src/protocol.rs | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/codex-rs/app-server-protocol/src/protocol/common.rs b/codex-rs/app-server-protocol/src/protocol/common.rs index cad6976b4b..42dd47397c 100644 --- a/codex-rs/app-server-protocol/src/protocol/common.rs +++ b/codex-rs/app-server-protocol/src/protocol/common.rs @@ -429,7 +429,7 @@ macro_rules! server_notification_definitions { ( $( $(#[$variant_meta:meta])* - $variant:ident $(=> $wire:literal)? ( $payload:ty ) + $variant:ident $(=> $wire:literal $(, aliases([$($alias:literal),* $(,)?]))? )? ( $payload:ty ) ),* $(,)? ) => { /// Notification sent from the server to the client. @@ -439,7 +439,14 @@ macro_rules! server_notification_definitions { pub enum ServerNotification { $( $(#[$variant_meta])* - $(#[serde(rename = $wire)] #[ts(rename = $wire)] #[strum(serialize = $wire)])? + $( + #[serde(rename = $wire)] + #[ts(rename = $wire)] + #[strum(serialize = $wire)] + $( + $(#[serde(alias = $alias)])* + )? + )? $variant($payload), )* } @@ -582,7 +589,7 @@ server_notification_definitions! { TurnStarted => "turn/started" (v2::TurnStartedNotification), TurnCompleted => "turn/completed" (v2::TurnCompletedNotification), TurnDiffUpdated => "turn/diff/updated" (v2::TurnDiffUpdatedNotification), - TurnPlanUpdated => "turn/plan/updated" (v2::TurnPlanUpdatedNotification), + TurnPlanUpdated => "turn/plan/updated", aliases(["turn/todo/updated"]) (v2::TurnPlanUpdatedNotification), ItemStarted => "item/started" (v2::ItemStartedNotification), ItemCompleted => "item/completed" (v2::ItemCompletedNotification), /// This event is internal-only. Used by Codex Cloud. diff --git a/codex-rs/app-server/README.md b/codex-rs/app-server/README.md index a8116c20c1..de12236910 100644 --- a/codex-rs/app-server/README.md +++ b/codex-rs/app-server/README.md @@ -433,7 +433,7 @@ The app-server streams JSON-RPC notifications while a turn is running. Each turn - `turn/started` — `{ turn }` with the turn id, empty `items`, and `status: "inProgress"`. - `turn/completed` — `{ turn }` where `turn.status` is `completed`, `interrupted`, or `failed`; failures carry `{ error: { message, codexErrorInfo?, additionalDetails? } }`. - `turn/diff/updated` — `{ threadId, turnId, diff }` represents the up-to-date snapshot of the turn-level unified diff, emitted after every FileChange item. `diff` is the latest aggregated unified diff across every file change in the turn. UIs can render this to show the full "what changed" view without stitching individual `fileChange` items. -- `turn/plan/updated` — `{ turnId, explanation?, todo, plan }` whenever the agent shares or changes its todo list; each entry is `{ step, status }` with `status` in `pending`, `inProgress`, or `completed`. `todo` is preferred and `plan` is a deprecated legacy alias; both are emitted for compatibility. (The plan-named event and field are legacy and are unrelated to Plan mode.) +- `turn/plan/updated` — `{ turnId, explanation?, todo, plan }` whenever the agent shares or changes its todo list; each entry is `{ step, status }` with `status` in `pending`, `inProgress`, or `completed`. `todo` is preferred and `plan` is a deprecated legacy alias; both are emitted for compatibility. Clients may also send/accept `turn/todo/updated` as a wire alias. (The plan-named event and field are legacy and are unrelated to Plan mode.) Today both notifications carry an empty `items` array even when item events were streamed; rely on `item/*` notifications for the canonical item list until this is fixed. diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index b28a99fd02..9da630fc60 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -812,6 +812,7 @@ pub enum EventMsg { /// Todo list update from the todo_write tool. Payload uses `todo` (preferred) /// and also emits `plan` as a legacy alias. + #[serde(alias = "todo_update")] PlanUpdate(UpdateTodoArgs), TurnAborted(TurnAbortedEvent),