Skip to content

Commit c63b23b

Browse files
committed
comment
1 parent e78c934 commit c63b23b

File tree

3 files changed

+99
-84
lines changed

3 files changed

+99
-84
lines changed

codex-rs/app-server-protocol/src/protocol/v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ pub struct AccountUpdatedNotification {
788788
pub struct ThreadTokenUsageUpdatedNotification {
789789
pub thread_id: String,
790790
pub turn_id: String,
791-
pub token_usage: Option<ThreadTokenUsage>,
791+
pub token_usage: ThreadTokenUsage,
792792
}
793793

794794
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]

codex-rs/app-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Event notifications are the server-initiated event stream for thread lifecycles,
240240

241241
### Turn events
242242

243-
The app-server streams JSON-RPC notifications while a turn is running. Each turn starts with `turn/started` (initial `turn`) and ends with `turn/completed` (final `turn` status). Token usage deltas stream separately via `thread/tokenUsage/updated`. Clients subscribe to the events they care about, rendering each item incrementally as updates arrive. The per-item lifecycle is always: `item/started` → zero or more item-specific deltas → `item/completed`.
243+
The app-server streams JSON-RPC notifications while a turn is running. Each turn starts with `turn/started` (initial `turn`) and ends with `turn/completed` (final `turn` status). Token usage events stream separately via `thread/tokenUsage/updated`. Clients subscribe to the events they care about, rendering each item incrementally as updates arrive. The per-item lifecycle is always: `item/started` → zero or more item-specific deltas → `item/completed`.
244244

245245
- `turn/started``{ turn }` with the turn id, empty `items`, and `status: "inProgress"`.
246246
- `turn/completed``{ turn }` where `turn.status` is `completed`, `interrupted`, or `failed`; failures carry `{ error: { message, codexErrorInfo? } }`.

0 commit comments

Comments
 (0)