Wire the PatchUpdated events through app_server (#18289)

Wires patch_updated events through app_server. These events are parsed
and streamed while apply_patch is being written by the model. Also adds 500ms of buffering to the patch_updated events in the diff_consumer.

The eventual goal is to use this to display better progress indicators in
the codex app.
This commit is contained in:
Akshay Nathan
2026-04-20 10:44:03 -07:00
committed by GitHub
parent 316cf0e90b
commit 34a3e85fcd
18 changed files with 613 additions and 6 deletions
@@ -40,6 +40,7 @@ use codex_app_server_protocol::ExecCommandApprovalResponse;
use codex_app_server_protocol::ExecPolicyAmendment as V2ExecPolicyAmendment;
use codex_app_server_protocol::FileChangeApprovalDecision;
use codex_app_server_protocol::FileChangeOutputDeltaNotification;
use codex_app_server_protocol::FileChangePatchUpdatedNotification;
use codex_app_server_protocol::FileChangeRequestApprovalParams;
use codex_app_server_protocol::FileChangeRequestApprovalResponse;
use codex_app_server_protocol::FileUpdateChange;
@@ -1636,6 +1637,17 @@ pub(crate) async fn apply_bespoke_event_handling(
.await;
}
}
EventMsg::PatchApplyUpdated(event) => {
let notification = FileChangePatchUpdatedNotification {
thread_id: conversation_id.to_string(),
turn_id: event_turn_id.clone(),
item_id: event.call_id,
changes: convert_patch_changes(&event.changes),
};
outgoing
.send_server_notification(ServerNotification::FileChangePatchUpdated(notification))
.await;
}
EventMsg::PatchApplyEnd(patch_end_event) => {
// Until we migrate the core to be aware of a first class FileChangeItem
// and emit the corresponding EventMsg, we repurpose the call_id as the item_id.