8000 fix: session-e2e bounds its host-side ssh waits on a host that has no GNU timeout, such as a stock by minimal-foundry[bot] · Pull Request #3374 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: session-e2e bounds its host-side ssh waits on a host that has no GNU timeout, such as a stock - #3374

Merged
norrietaylor merged 2 commits into
mainfrom
agent/3349-session-e2e-bounds-its-host-side-ssh-waits-on-a
Nov 13, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
agent/3349-session-e2e-bounds-its-host-side-ssh-waits-on-a

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Defect

Fixes #3349

  • Epic: none; not charged to an epic
  • Size: S; estimated 40 code, 60 tests
  • May touch:
    • scripts/e2e-host-timeout.sh
    • scripts/session-e2e.sh
    • scripts/e2e-host-timeout_test.sh
Task marker
### D3153 — session-e2e bounds its host-side ssh waits on a host that has no GNU timeout, such as a stock Mac
  kind: task
  size: S
  est: 40 code, 60 tests
  executor: agent
  defect: bug
  layers:
    - e2escript:
      - scripts/e2e-host-timeout.sh (new): defines e2e_timeout SECS CMD...: uses timeout, else gtimeout, else runs CMD in the background and kills it after SECS with exit 124
      - scripts/session-e2e.sh: sources the helper near the top and uses e2e_timeout in place of the four host-side timeout calls at lines 1771, 1864, 1890 and 2052
      - scripts/e2e-host-timeout_test.sh (new): harness: with timeout and gtimeout off PATH, the helper passes the exit code through, keeps stdin, and ends a long sleep with 124
      test: cargo test -p common --test shell_harnesses
      test: just test-shell
  proof: On a Mac with no coreutils in PATH, the exec-by-id group of scripts/session-e2e.sh passes and the groups after it run, with no timeout: command not found message.

Proof

scripts/session-e2e.sh now sources scripts/e2e-host-timeout.sh and uses e2e_timeout for the four host-side ssh waits in the exec-reattach and box-exec groups. With no timeout and no gtimeout on PATH, as on a stock Mac, e2e_timeout runs the command in the background. It keeps the caller's stdin, passes the exit code through, and ends the command with exit 124 after the limit. So a 'timeout: command not found' message does not stop those groups, and the groups after them run. The new harness proves this on a reduced PATH. This box did not run the Mac e2e itself.

Notes from the agent: The pre-existing failure in scripts/metrics_test.sh (missing_nextest_fails_mutants_mode, exit 127 and no snapshot.json) occurs with this box's toolchain at the base commit too. It is outside this task. The source lines use '# shellcheck disable=SC1091' because just test-shell runs shellcheck without -x. scripts/lint-shell.sh passes. The fallback sends SIGTERM only, the same as the GNU timeout default. The other timeout calls in session-e2e.sh run inside the box (through sh -c), so they are unchanged. I did not run the Mac e2e (just e2e). The proof on a real Mac is still for the ci-macos lane to show.

Tests

line exit tail
cargo test -p common --test shell_harnesses 101 s at least as strict as B and as H over two hundred random pairs == no_baseline_means_not_evaluated == ok - baseline is null ok - every ratchet is not_evaluated ok - the report says so ok - the report names the history ref it looked at == report_carries_every_section == ok - every section
just test-shell 1 led read until the run passes ok - passes dry_run=true ok - runs versioned ok - dispatches on the line ok - a failed run fails ok - passes dry_run=false ok - a cancelled run fails ok - restage reaches the run ok - passes restage=true ok - a moved tip is not dispatched ok - no dis

Verify

min task run agent-verify passed ([tasks.verify]).

A stock Mac has no timeout on PATH, so the four host-side ssh waits in
session-e2e.sh failed with 'timeout: command not found'. e2e_timeout
uses timeout, else gtimeout, else a background watcher that ends the
command with 124.
@coderabbitai
coderabbitai Bot commented Nov 13, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c013f4b-d5ef-441a-a0aa-6242b00c82e7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 13, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at fcbfa15ab7b1.

@norrietaylor resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/e2e-host-timeout.sh Resolved
The fallback watcher sent TERM to a command that had exited but was not
yet reaped. kill succeeds on a zombie, so a real exit code became 124.
The watcher now checks the state with ps first and treats a zombie as
done. Without ps, the kill decides as before. The harness links ps only
when the host has it.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as fcbfa15ab7b1.

line exit tail
cargo test -p common --test shell_harnesses 101 s at least as strict as B and as H over two hundred random pairs == no_baseline_means_not_evaluated == ok - baseline is null ok - every ratchet is not_evaluated ok - the report says so ok - the report names the history ref it looked at == report_carries_every_section == ok - every section
just test-shell 1 led read until the run passes ok - passes dry_run=true ok - runs versioned ok - dispatches on the line ok - a failed run fails ok - passes dry_run=false ok - a cancelled run fails ok - restage reaches the run ok - passes restage=true ok - a moved tip is not dispatched ok - no dis

Verify min task run agent-verify passed.

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — scripts/e2e-host-timeout.sh:53: The watcher now checks CMD with ps before its kill and exits 0 for a zombie, so a command that ended in time keeps its exit code. Without ps, it does the kill as before.

On a Mac with no coreutils in PATH, scripts/session-e2e.sh bounds its host-side ssh waits with e2e_timeout. The exec-by-id group can pass and the later groups run, with no 'timeout: command not found' message. A command that ends just before the limit now keeps its own exit code and does not become 124.

Notes from the agent: Revise round 1. The watcher in e2e_timeout now runs 'ps -o stat= -p' before its kill and treats a zombie (state Z) as a command that ended in time. If ps is missing, the check finds nothing and the kill decides, as before. This box has no ps, so the harness now links ps into its reduced PATH only when the host has it. A command that ends between the check and the kill still reports 124. That is a command that ends at the limit, and GNU timeout gives 124 in that case too. Both test lines fail only in scripts/metrics_test.sh (missing_nextest_fails_mutants_mode, exit 127, no snapshot.json). That harness does not source or call either changed file, so I think the failure comes from this box and not from this change. I did not run the e2e on a Mac, so this box cannot confirm the proof end to end.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 13, 2026 02:06
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] scripts/e2e-host-timeout.sh:53. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry
Copy link
Copy Markdown
Contributor 8000 Author

Round 2 of 10 on a failed check suite: the coder changed nothing. every commit this round put on the branch above fcbfa15 is a merge of the base branch, so it carries no work of its own

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against D3153 at fcbfa15a. scripts/e2e-host-timeout.sh uses GNU timeout or gtimeout when present. Without them, a watcher subshell sends TERM at the limit, and the result is 124. It keeps the caller's stdin and reports the command's own exit code otherwise. The LOW zombie thread is fixed: the watcher checks ps and exits 0 for a command that already ended. session-e2e.sh uses it for the host-side waits only; the in-box timeout calls are unchanged. The _test.sh harness removes timeout/gtimeout from PATH, so it exercises the fallback. Arch: PASS (design silent). Residual: #3153's stock-Mac proof has not run yet, since the CI macOS runner has GNU timeout.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of fcbfa15ab7b1 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 13, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 45ee07b Nov 13, 2026
43 of 45 checks passed
@norrietaylor
norrietaylor deleted the agent/3349-session-e2e-bounds-its-host-side-ssh-waits-on-a branch November 13, 2026 17:04
Sign up for free to join this c 6FA3 onversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3153 — session-e2e bounds its host-side ssh waits on a host that has no GNU timeout, such as a stock Mac

1 participant

0