Repository navigation
Conversation
Contributor
svcnvidia-nemo-ci
left a comment
Contributor
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I checked the updated recovery test against the terminal’s interrupt and recovery paths. Both exit triggers retain the assertions for discarded pending input, preserved files, and reset shell state.
Static review only; I did not run tests.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
ananthsub
added a commit
that referenced
this pull request
Nov 10, 2026
Several core, model, agent and terminal_bench_4 tests gave real work a deadline of tens of milliseconds, or bounded how long it took, and failed whenever a busy CI runner was slower. Give deadlines that must not fire room for a slow runner, hold the first model attempt on an event so only it times out, replace the elapsed bound on concurrent stale-copy deletion with a gate that every deletion must reach, and apply the 25 ms verifier budget only to the terminal_bench_4 cases meant to run out of it. The exec-transport and supervision changes moved to #5933 and the terminus changes to #5943. Signed-off-by: Ananth Subramaniam <[email protected]>
The interrupt case of the exited-shell recovery test sent Ctrl-C a fixed 0.3 s after typing `set -e; sleep 120`. When the Ctrl-C arrived before sleep started, bash took it at the prompt, survived, and the pane never died, so the test failed most runs even on an idle host. Poll until sleep is the pane's foreground command before pasting the queued input and sending Ctrl-C, and poll for the dead pane with a 30 s deadline instead of a fixed 10 s loop. The polling helper matches the one #5901 adds for the full-PTY test in the same file. Signed-off-by: Ananth Subramaniam <[email protected]>
Make the polling helper raise with the last value it saw instead of returning False, matching the copy in #5901, and use it for the RECOVERED output wait in place of a silent fixed loop. Queue 1024 commands (about 95 KB) instead of 32768 (about 1.3 MB). That is still far beyond the 4 KB kernel input queue, so the test still needs the drain. The smaller payload keeps the input drain's fixed 5 s budget from running out on a busy runner. Signed-off-by: Ananth Subramaniam <[email protected]>
…e pane log Bring the full-PTY Ctrl-C test fix over from #5901 so all terminus test fixes land together. The test now polls until sleep is the foreground command before sending the raw Ctrl-C, and polls the pane for TERMINAL_RECOVERED and the raw-mode bytes instead of reading it once. Under load it failed with `'bash' == 'sleep'` when the pane was read before sleep had started. The exited-shell recovery test also polls pane.log for the RECOVERED line. pipe-pane writes the log through a separate process, so the log can lag the screen that the earlier wait already checked. Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub
force-pushed
the
ananthsub/terminus-interrupt-race
branch
from
November 10, 2026 17:03
446a8c1 to
5ce5723
Compare
ananthsub
added a commit
that referenced
this pull request
Nov 10, 2026
Several core, model, agent and terminal_bench_4 tests gave real work a deadline of tens of milliseconds, or bounded how long it took, and failed whenever a busy CI runner was slower. Give deadlines that must not fire room for a slow runner, replace the elapsed bound on concurrent stale-copy deletion with a gate that every deletion must reach, and apply the 25 ms verifier budget only to the terminal_bench_4 cases meant to run out of it. The exec-transport and supervision changes moved to #5933 and the terminus changes to #5943. Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub
added a commit
that referenced
this pull request
Nov 11, 2026
Several core, model, agent and terminal_bench_4 tests gave real work a deadline of tens of milliseconds, or bounded how long it took, and failed whenever a busy CI runner was slower. Give deadlines that must not fire room for a slow runner, replace the elapsed bound on concurrent stale-copy deletion with a gate that every deletion must reach, and apply the 25 ms verifier budget only to the terminal_bench_4 cases meant to run out of it. The exec-transport and supervision changes moved to #5933 and the terminus changes to #5943. Signed-off-by: Ananth Subramaniam <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
This PR collects the timing fixes for the Terminus sandboxed agent's terminal tests. Two tmux-backed Ctrl-C tests sent keys after a fixed delay and assumed
sleepwas already running. Both failed when it was not.Exited-shell recovery test, interrupt case. The test types
set -e; sleep 120and sends Ctrl-C a fixed 0.3 s later, then expects the pane to die. If Ctrl-C arrives beforesleepstarts, bash receives it at the prompt and keeps running, so the pane never dies. The test then fails withpane_deadstill0. In my own check on an unloaded host, the unmodified test failed all five isolated runs. The test now:sleepis the pane's foreground command before it pastes the queued input and sends Ctrl-CRECOVEREDoutput after recovery with the polling helper, instead of a fixed loop that ended without saying what it last sawpane.logfor the same line, becausepipe-panewrites the log through a separate process and the log can lag the screenThe 95 KB payload is still far more than the 4 KB kernel input queue, so tmux still holds pending input when the shell dies. The failure case (
sleep 2; false) skips the new wait forsleep, because a slow runner could see thatsleepfinish before the poll.Full-PTY Ctrl-C test. The test typed
sleep 120, waited a fixed 0.3 s, and then checked thatsleepwas still running after a raw Ctrl-C. On a loaded runner the pane could be read beforesleephad started, which failed withassert 'bash' == 'sleep'. A reviewer saw this in several of 20 loaded rounds. The test now polls untilsleepis running before it sends the raw Ctrl-C. It still waits 0.2 s and reads once to check thatsleepsurvived, because a slow runner can only makesleeplook more stuck. The later checks forTERMINAL_RECOVEREDand for the raw-mode bytes poll the pane instead of reading it once.The full-PTY fix moves here from #5901, which no longer touches this file, so all Terminus test fixes land together. Both tests share one
eventuallyhelper. It polls until a condition holds and raises an error that includes the last value it saw.Issue: none. This is a small test-only follow-up to the timing audit in #5901.
Validation
All runs used a venv built from the server lock file (
uv sync --frozen --all-extrasinresponses_api_agents/terminus_2_sandboxed_agent) on a 24-core host:pytest -n 16 tests/test_terminal.pypassed every test in 13 rounds. Ten rounds ran with 24 busy loops spinning. Other work kept the host's load average above 100 throughout.pane.logpoll was added, 4 more rounds under the same load passed every test.-n 16with 24 busy loops passed every test. Removing the drain makes both Ctrl-C tests fail.pre-commit run --fileson the changed file passed.A separate bug in the product's input drain can still lose Ctrl-C or give up too early under heavy parallelism. That bug is being fixed in #5951, which is stacked on this PR. The smaller payload keeps this test within the drain's fixed 5-second budget under load, but this test can still fail on the drain's false-quiet bug under heavy parallelism until that fix lands.
Rollout evidence
N/A: test-only change with no agent or verifier behavior change.