mirror of
https://github.com/openai/codex.git
synced 2026-05-04 21:32:21 +03:00
[codex] Send realtime transcript deltas on handoff (#18761)
## Summary - Track how many realtime transcript entries have already been attached to a background-agent handoff. - Attach only entries added since the previous handoff as `<transcript_delta>` instead of resending the accumulated transcript snapshot. - Update the realtime integration test so the second delegation carries only the second transcript delta. ## Validation - `just fmt` - `cargo test -p codex-api` - `cargo test -p codex-core inbound_handoff_request_sends_transcript_delta_after_each_handoff` - `cargo build -p codex-cli -p codex-app-server` ## Manual testing Built local debug binaries at: - `codex-rs/target/debug/codex` - `codex-rs/target/debug/codex-app-server`
This commit is contained in:
@@ -217,6 +217,7 @@ pub struct RealtimeWebsocketEvents {
|
||||
#[derive(Default)]
|
||||
struct ActiveTranscriptState {
|
||||
entries: Vec<RealtimeTranscriptEntry>,
|
||||
last_handoff_entry_count: usize,
|
||||
new_input_entry: bool,
|
||||
new_output_entry: bool,
|
||||
}
|
||||
@@ -459,7 +460,10 @@ impl RealtimeWebsocketEvents {
|
||||
}
|
||||
RealtimeEvent::HandoffRequested(handoff) => {
|
||||
append_handoff_input(&mut active_transcript.entries, &handoff.input_transcript);
|
||||
handoff.active_transcript = active_transcript.entries.clone();
|
||||
handoff.active_transcript = active_transcript.entries
|
||||
[active_transcript.last_handoff_entry_count..]
|
||||
.to_vec();
|
||||
active_transcript.last_handoff_entry_count = active_transcript.entries.len();
|
||||
active_transcript.new_input_entry = true;
|
||||
active_transcript.new_output_entry = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user