[app-server] feat: add thread_id and turn_id to item and error notifications (#7124)

Add `thread_id` and `turn_id` to `item/started`, `item/completed`, and
`error` notifications. Otherwise the client will have a hard time
knowing which thread & turn (if multiple threads are running in
parallel) a new item/error is for.

Also add `thread_id` to `turn/started` and `turn/completed`.
This commit is contained in:
Owen Lin
2025-11-25 08:05:47 -08:00
committed by GitHub
parent 37d83e075e
commit 157a16cefa
5 changed files with 149 additions and 22 deletions

View File

@@ -2478,7 +2478,10 @@ impl CodexMessageProcessor {
self.outgoing.send_response(request_id, response).await;
// Emit v2 turn/started notification.
let notif = TurnStartedNotification { turn };
let notif = TurnStartedNotification {
thread_id: params.thread_id,
turn,
};
self.outgoing
.send_server_notification(ServerNotification::TurnStarted(notif))
.await;
@@ -2536,7 +2539,7 @@ impl CodexMessageProcessor {
let response = TurnStartResponse { turn: turn.clone() };
self.outgoing.send_response(request_id, response).await;
let notif = TurnStartedNotification { turn };
let notif = TurnStartedNotification { thread_id, turn };
self.outgoing
.send_server_notification(ServerNotification::TurnStarted(notif))
.await;