fix(verify): close stdin for helper commands so incus launch cannot hang#1801

merged1
main
verify-fast/m1-incus-stdin
openedOct 13, 2026byNNick
View on GitHubGitHub import enabledPR last imported 21d ago

verify-cluster up could hang forever when the caller left stdin open. incus launch reads stdin when it is not a terminal, so a harness that kept stdin attached (an agent shell, a pipeline) waited on a launch that never returned.

Every helper command now gets stdin=DEVNULL by default, through Commands.__call__ and incus.query. The exec and cli passthroughs keep the caller's stdin, because those run interactive commands on a Machine.

Proof. Before the fix, a repro with stdin held open waited 30 s against 0.156 s with stdin closed, and the new unit test failed on its 5 s timeout. After the fix, on real Incus with the caller's stdin held open (< <(sleep 7200)), the bake's incus launch images:ubuntu/24.04 exited 0 in 9.3 s, the run's launch exited 0 in 26.9 s, and a full up --daemon 0.3.0-beta.1 came up in 676.7 s with exit 0.

Checks. core/scripts/verify/test_commands.py covers an open stdin and passing input, and runs in the CI contracts job.

Checks

1 pending Ā· 15 successful Ā· 1 skipped
Checks in progress

In progress1

86d5709
Synced from GitHub

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

āš™ļø Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd02a1e8-25f4-4bee-83e8-0aa548ec73fe
šŸ“„ Commits

Reviewing files that changed from the base of the PR and between c6cff8720a78065fe3f90eaa323a8813e375cfe1 and 86d57096871d5c14ce8867f70ef7062bf6fc34e1.

šŸ“’ Files selected for processing: 4
  • .github/workflows/ci.yml
  • core/scripts/verify-cluster
  • core/scripts/verify/incus.py
  • core/scripts/verify/test_commands.py
ascii
1 _________________________________________________
2< I am the right brain to your SAST's left brain. >
3 -------------------------------------------------
4 \
5 \ (\__/)
6 (•ㅅ•)
7 / 怀 恄
✨ Finishing Touches
šŸ“ Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix Ā· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Added 1 commit

  • fix(verify): close stdin for helper commands so incus launch cannot hang86d5709
Synced from GitHub

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
šŸ“ Code Reviewāœ… Completed 2026-10-13T23:25:32.992189Z86d5709Draft marked ready
ā„¹ļø About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with šŸ‘€ while any review is running, comments if it has suggestions, and reacts with šŸ‘ once all reviews finish with no findings.