mirror of
https://github.com/openai/codex.git
synced 2026-05-04 21:32:21 +03:00
Stream apply_patch changes (#17862)
Adds new events for streaming apply_patch changes from responses api. This is to enable clients to show progress during file writes. Caveat: This does not work with apply_patch in function call mode, since that required adding streaming json parsing.
This commit is contained in:
@@ -1546,6 +1546,9 @@ pub enum EventMsg {
|
||||
/// `ExecCommandBegin` so front‑ends can show progress indicators.
|
||||
PatchApplyBegin(PatchApplyBeginEvent),
|
||||
|
||||
/// Latest model-generated structured changes for an `apply_patch` call.
|
||||
PatchApplyUpdated(PatchApplyUpdatedEvent),
|
||||
|
||||
/// Notification that a patch application has finished.
|
||||
PatchApplyEnd(PatchApplyEndEvent),
|
||||
|
||||
@@ -3240,6 +3243,14 @@ pub struct PatchApplyBeginEvent {
|
||||
pub changes: HashMap<PathBuf, FileChange>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct PatchApplyUpdatedEvent {
|
||||
/// Identifier for the originating `apply_patch` tool call.
|
||||
pub call_id: String,
|
||||
/// Structured file changes parsed from the model-generated patch input so far.
|
||||
pub changes: HashMap<PathBuf, FileChange>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct PatchApplyEndEvent {
|
||||
/// Identifier for the PatchApplyBegin that finished.
|
||||
|
||||
Reference in New Issue
Block a user