fix(ecc2): resolve kill_process duplicate definition on Windows (#2195)

On Windows both cfg(windows) and cfg(not(unix)) evaluate true, so the sync taskkill kill_process and the async taskkill kill_process both compiled in and collided (E0428). Call sites are synchronous and never await it (passed as a fn pointer to enforce_session_heartbeats_with, and called as kill_process(pid)? in stop_session_recorded), so remove the stray async cfg(not(unix)) definition. The sync cfg(windows) version already handles termination via taskkill /T /F.
This commit is contained in:
mohameddsh3ban 2026-06-15 20:48:42 +03:00 committed by GitHub
parent 2b393c3ce1
commit 0ce14a423c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3634,24 +3634,6 @@ fn send_signal(pid: u32, signal: i32) -> Result<()> {
Err(error).with_context(|| format!("Failed to kill process {pid}"))
}
#[cfg(not(unix))]
async fn kill_process(pid: u32) -> Result<()> {
let status = Command::new("taskkill")
.args(["/F", "/PID", &pid.to_string()])
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.await
.with_context(|| format!("Failed to invoke taskkill for process {pid}"))?;
if status.success() {
Ok(())
} else {
anyhow::bail!("taskkill failed for process {pid}");
}
}
pub struct SessionStatus {
harness: SessionHarnessInfo,
profile: Option<SessionAgentProfile>,