You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tower-cron runs task commands through cmd.exe on Windows instead of commandLaunch (Git Bash) #1930
tower-cron.ts runs each cron task's command with raw child_process.exec. On native Windows that is cmd.exe /d /s /c. Every other shell-string call site goes through commandLaunch(), whose Windows implementation runs shell strings in the resolved Git Bash and never in cmd.exe (Spec 1658; packages/codev/src/lib/platform/windows/command-launch.ts).
So a cron task that adopters write the normal POSIX way (single quotes, $(…), && chains with POSIX tools) works on macOS/Linux and breaks on Windows. #1921 fixed the two shipped ci-health tasks by switching to quoting both shells accept, and documented the cmd.exe caveat. It did not change the shell, so the trap remains for user-written tasks. With an exitCode == 0 condition the failure now only logs a WARN, which means a broken task can go unnoticed.
Cause
runCommand() in packages/codev/src/agent-farm/servers/tower-cron.ts calls exec() directly. commandLaunch().execShellString returns stdout and throws on a non-zero exit. Cron needs the exit code (and the output of a failed run) as data for condition, so it cannot use that method as it stands.
Fix shape
Add a commandLaunch method that runs a shell string and returns { output, exitCode } without throwing on a non-zero exit (timeout/kill still distinguishable), with the Git Bash branch on Windows and /bin/sh elsewhere.
Route tower-cron's runCommand through it, keeping sanitizeAgentEnv, cwd, timeout, maxBuffer.
Activity