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.
This commit is contained in:
Helios Agent 2026-03-03 14:17:56 +01:00
parent 9e6878a93f
commit 346386db99
No known key found for this signature in database
GPG key ID: C8259547CD8309B5

View file

@ -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 {