Finished SSH commands wait for client input to close

perfloop-oss/breakpoint · Synchronous Wait

https://perfloop.ai/t/oss/case_g2hg81j79f

Verdict

VERIFIED · settled 2026-11-11 · pull request opened as namespacelabs/breakpoint#32

What happened: The check fails before this change and passes with it.

Hypothesis

A completed SSH command can keep its session open while the server waits for more client input. This delays completion and retains session work after the command has exited. The frequency of clients leaving stdin open in deployed traffic is unknown.

The configured wait command installs this handler. Its non-PTY branch assigns the SSH session to cmd.Stdin and calls cmd.Wait. Go's command runner waits for its input-copy goroutine after reaping the process. The SSH library sends completion and closes the channel only after the handler returns. A client waiting for completion with stdin still open therefore leaves that input copy waiting on the same channel.

The stored check for prop_ka471cd4g4 ran `go test ./pkg/sshd -run '^TestPerfloopExecCompletesWithOpenStdin$' -count=1 -timeout=20s -v`. Run call_SS5dPOTPqrNV7PM1j7GW2NgN failed on one authenticated loopback exec: the shell printed its PID and exited without reading input; the test confirmed that process was reaped; completion remained blocked for two seconds; sending stdin EOF then completed successfully. The two-second window is a bounded observation, not a proposed product timeout. Confidence is medium for this source-owned completion defect, not for its production prevalence.

A Case can independently replay that sequence, then verify completion after process exit without losing running-command input or final output. The checker layout is provisional. This does not request cancellation of live or deliberately detached processes.

Merged https://github.com/namespacelabs/breakpoint/pull/31 contains the current input wiring and wait behavior; it does not resolve this completion dependency. Open https://github.com/namespacelabs/breakpoint/pull/27 adds output-driven breakpoint extension, not input-copy termination. Contribution guidance names GitHub as the review venue. Earlier file history remains a gap: the checkout is shallow and the bounded commits-API read returned HTTP 403.

Change to test: Make non-PTY command completion depend on process exit and output draining, not on future client input. Preserve input delivery while the command is running, completed stdout/stderr, configured shell and environment behavior, and existing start-error handling; end the input-copy lifetime when the command finishes.

Where it lives

perfloop-oss/breakpoint · cmd/breakpoint/wait.go

Evidence

The check fails before this change and passes with it: `Authenticated non-PTY SSH exec commands that exit without reading stdin report completion with their final stdout and stderr, without requiring client stdin EOF.`

Checks: 3 of 3 passed. Verification: no defect found.

Timeline