diff --git a/crates/worker/src/worker.rs b/crates/worker/src/worker.rs index 376a82bec..4313a184f 100644 --- a/crates/worker/src/worker.rs +++ b/crates/worker/src/worker.rs @@ -3474,7 +3474,9 @@ impl Worker { LogEntry::RunCompleted { .. } | LogEntry::RunYielded { .. } | LogEntry::RunResumed { .. } => Some(CommittedRunExit::NonFinal), - LogEntry::RunErrored { .. } => Some(CommittedRunExit::Interrupted), + LogEntry::RunCancelled { .. } | LogEntry::RunErrored { .. } => { + Some(CommittedRunExit::Interrupted) + } _ => None, }) .unwrap_or(CommittedRunExit::NonFinal); @@ -11252,7 +11254,7 @@ mod build_summary_prompt_tests { .commit_entry(LogEntry::RunErrored { ts: segment_log::now_millis(), interrupted: true, - message: "cancelled".to_string(), + message: "provider failed".to_string(), failure: Some(RunFailureKind::Engine), }) .unwrap(); @@ -11272,6 +11274,22 @@ mod build_summary_prompt_tests { capture_handle.capture().unwrap().run_exit, CommittedRunExit::Finished ); + worker + .commit_entry(LogEntry::Invoke { + ts: segment_log::now_millis(), + trigger: protocol::InvokeKind::UserSend, + }) + .unwrap(); + worker + .commit_entry(LogEntry::RunCancelled { + ts: segment_log::now_millis(), + }) + .unwrap(); + assert_eq!( + capture_handle.capture().unwrap().run_exit, + CommittedRunExit::Interrupted, + "a current cancellation must not inherit an earlier finished run" + ); worker .commit_entry(LogEntry::RunResumed { ts: segment_log::now_millis(),