From 346386db9922bb383d2ad049e21c989b8fe55eca Mon Sep 17 00:00:00 2001 From: Helios Agent Date: Tue, 3 Mar 2026 14:17:56 +0100 Subject: [PATCH] fix(client): use contains() for sentinel detection to fix Windows timeout On Windows, cmd.exe echoes the full prompt before the command output, so the sentinel line looks like: C:\Users\Moritz\Desktop>__HELIOS_DONE__0\r\n starts_with(SENTINEL) never matched. Switching to contains() + finding the sentinel position fixes detection on both Windows and Unix. --- crates/client/src/shell.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/client/src/shell.rs b/crates/client/src/shell.rs index 39addca..9593938 100644 --- a/crates/client/src/shell.rs +++ b/crates/client/src/shell.rs @@ -119,9 +119,13 @@ impl PersistentShell { } Ok(Ok(_)) => { debug!("stdout line: {line:?}"); - if line.trim_end().starts_with(SENTINEL) { - // Parse exit code from sentinel line - let code_str = line.trim_end().trim_start_matches(SENTINEL); + if line.contains(SENTINEL) { + // Parse exit code from sentinel line (use contains for Windows + // compatibility: cmd.exe echoes the prompt before the sentinel, + // e.g. "C:\Users\...>__HELIOS_DONE__0\r\n") + let sentinel_pos = line.find(SENTINEL).unwrap_or(0); + let code_str = &line[sentinel_pos..]; + let code_str = code_str.trim_end().trim_start_matches(SENTINEL); exit_code = code_str.trim().parse().unwrap_or(0); break; } else {