Skip to content

Commit 405b69b

Browse files
committed
codex: fix CI failure on PR #30283
1 parent 84b7cda commit 405b69b

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

codex-rs/core/src/unified_exec/process_manager.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,8 @@ impl UnifiedExecProcessManager {
577577
}
578578
}
579579
} else {
580-
// Short‑lived command: emit ExecCommandEnd immediately using the
581-
// same helper as the background watcher, so all end events share
582-
// one implementation.
580+
// Short-lived command: emit the completed command item immediately
581+
// using the same helper as the background watcher.
583582
let finish_result = finish_deferred_network_approval_after_process_exit_for_session(
584583
Some(&context.session),
585584
deferred_network_approval.take(),

codex-rs/core/src/unified_exec/process_manager_tests.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -315,21 +315,24 @@ async fn failed_initial_end_for_unstored_process_uses_fallback_output() {
315315

316316
let event = tokio::time::timeout(Duration::from_secs(1), rx_event.recv())
317317
.await
318-
.expect("timed out waiting for failed exec end event")
318+
.expect("timed out waiting for failed command execution item")
319319
.expect("event channel closed");
320-
let codex_protocol::protocol::EventMsg::ExecCommandEnd(end_event) = event.msg else {
321-
panic!("expected ExecCommandEnd event");
320+
let codex_protocol::protocol::EventMsg::ItemCompleted(completed_event) = event.msg else {
321+
panic!("expected ItemCompleted event");
322322
};
323-
assert_eq!(end_event.call_id, "call-unified-denied");
323+
let codex_protocol::items::TurnItem::CommandExecution(item) = completed_event.item else {
324+
panic!("expected CommandExecution item");
325+
};
326+
assert_eq!(item.id, "call-unified-denied");
324327
assert_eq!(
325-
end_event.status,
326-
codex_protocol::protocol::ExecCommandStatus::Failed
328+
item.status,
329+
codex_protocol::items::CommandExecutionStatus::Failed
327330
);
328-
assert_eq!(end_event.exit_code, -1);
329-
assert_eq!(end_event.process_id.as_deref(), Some("123"));
331+
assert_eq!(item.exit_code, Some(-1));
332+
assert_eq!(item.process_id.as_deref(), Some("123"));
330333
assert_eq!(
331-
end_event.aggregated_output,
332-
"PRE_DENIAL_MARKER\nNetwork access denied"
334+
item.aggregated_output.as_deref(),
335+
Some("PRE_DENIAL_MARKER\nNetwork access denied")
333336
);
334337
}
335338

0 commit comments

Comments
 (0)