Repository navigation
fix(tether): propagate supervised command failures - #4598
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
If child.wait() returns an I/O error, the Err(e) arm marks the trace failed, but failed_status remains None and step_tether returns Ok(()) after the sweep. That reports a failed supervisor wait as a successful command. Propagate the wait error after the final sweep, as the previous commit did.
worktrunk-bot
left a comment
There was a problem hiding this comment.
codecov/patch fails at 85.71% (6 of 7 added executable lines covered). The uncovered line is the child.wait() error arm (Err(e) => trace.fail(e)); the exit-status regression test covers the normal wait path. The code change resolves the prior wait-error finding, but the repository's Coverage rule in AGENTS.md requires explicit maintainer approval before merging with a failing patch check.
# Conflicts: # src/commands/step/tether.rs
|
@worktrunk-bot two changes: check
|
Ctrl-C now returns WorktrunkError::Interrupted before the child's status is considered, so wt exits by SIGINT without a "killed by signal" report. A command the reaper tears down after worktree removal exits 0; only a command that exits on its own passes its status through. The wait no longer goes through ForegroundSignals::wait, which classifies a child's SIGTERM death as foreground cancellation: the reaper's own teardown SIGTERM was surfacing as cancellation (exit 143) on both paths.
|
Both changes are in dec9121.
Checking The removal and Ctrl-C integration tests now check the exit status, and the Ctrl-C test also checks that stderr is empty. All five |
|
CI on dec9121 is green except |
wt step tetherreturned success even when the command it supervised failed, which hid a failed dev server or other supervised task from scripts and hook logs. It now passes the command's exit status through when the command exits on its own. It still sweeps the process group first, and it uses the same child-status error as the other command runners. Two cases are not reported as a failure of the command:src/commands/custom.rs.To make these distinctions, tether waits with
forward_to_childrenpluswait_shared_childinstead ofForegroundSignals::wait. The latter classifies any child that dies from SIGTERM as foreground cancellation, so tether's own teardown SIGTERM surfaced as an interruption (exit 143). Cancellation now counts only signals thatwtitself received.Verification: the
step_tetherintegration tests cover all three outcomes.sh -c 'exit 7'exits 7. Removing the worktree exits 0. Ctrl-C exits by SIGINT with empty stderr. All five pass locally, and before the wait change the removal and Ctrl-C assertions failed with exit 143. Thechild.wait()I/O-error arm is uncovered, which the maintainer accepted.