fix: exit 0 on bare Windows launch instead of bailing
A bare launch of sigit.exe (TTY stdin, no arguments) falls through to the non-Unix interactive branch, which called anyhow::bail! and returned a non-zero exit code. winget's installer validator launches the installed executable with no arguments and treats a non-zero exit as a failure (Validation-Executable-Error, PR #446504). There is no TUI on non-Unix (the interactive client relies on Unix-only fd redirection), so a bare launch has nothing to do. Print a short usage message pointing at ACP and headless modes and exit Ok(()) (exit 0). Co-Authored-By: siGit Code v1.6.7-acp <noreply@sigit.si>
Seto Elkahfi committed
Oct 11, 2026 at 20:23 UTC
52b8cc34221a4d91d05078e8bef05345364b1993
1 file changed
+20
-1
src/main.rs
+20
-1
@@ -6663,7 +6663,26 @@ async fn main() -> anyhow::Result<()> {
6663
}
6664
#[cfg(not(unix))]
6665
{
6666
- anyhow::bail!("interactive mode requires Unix (macOS / Linux)");
6666
+ // No TUI on non-Unix: the interactive full-screen client relies on
6667
+ // fd redirection that only exists on Unix. A bare launch in a
6668
+ // terminal (the common case, and exactly what the winget installer
6669
+ // validator does — run `sigit.exe` with no arguments) therefore has
6670
+ // nothing to do, so print how to use the binary and exit cleanly.
6671
+ // Bailing here instead would return a non-zero exit code, which the
6672
+ // validator reads as a failure (Validation-Executable-Error).
6673
+ println!(
6674
+ "siGit Code v{}\n\n\
6675
+ Interactive terminal mode is Unix-only (macOS / Linux). On this \
6676
+ platform sigit runs as an ACP agent for editor integration, or \
6677
+ non-interactively from a script:\n\n\
6678
+ \x20 sigit run \"<prompt>\" run one prompt and exit\n\
6679
+ \x20 sigit --version print the version\n\
6680
+ \x20 sigit login sign in to siGit Code Cloud\n\n\
6681
+ Point your editor's ACP client at this binary to use it \
6682
+ interactively.",
6683
+ env!("CARGO_PKG_VERSION")
6684
+ );
6685
+ Ok(())
6686
}
6687
} else {
6688
// ACP mode: keep stdout untouched for protocol JSON only.