check / check (push) Failing after 1s
Main ran the command tree on a background context, so SIGINT, SIGTERM or SIGHUP killed the process before the deferred cleanup ran: the agent's temporary directory and socket, and the install working directory, were left behind. Main now runs the tree on a signal.NotifyContext for those three signals. A signal cancels the context, which ends the child ssh or sftp started with exec.CommandContext, and the deferred cleanup then runs. The exit status after a signal stays 1 unless ssh reported one of its own. For "ssh to" the child is cancelled with SIGTERM rather than the default kill, so ssh restores the terminal before it goes. Model: opus-4-8