Conversation
Normalize standalone control keys, preserve raw-terminal input semantics, and avoid replaying unchanged terminal output as new. Fall back to token counting when a model response omits usage. Signed-off-by: Frederic Lafrance <flafrance@nvidia.com>
Read pending input until an idle interval instead of assuming one read window empties a large paste. Bound recovery to five seconds and retain raw-terminal key handling. Signed-off-by: Frederic Lafrance <flafrance@nvidia.com>
Signed-off-by: Frederic Lafrance <flafrance@nvidia.com>
This branch has not been 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.
When a foreground process stops reading stdin, queued input can fill the terminal buffer and trap Ctrl-C behind a paste. Terminus then receives unchanged observations indefinitely. Adding a newline to a standalone control key also turns it into literal text, despite the parser suggesting that newline. If the interactive shell exits, including after an interrupt with
set -eenabled, Harbor can return normally before the model declares completion.Normalize standalone control keys, drain cancelled input until quiet before sending native Ctrl-C (with a five-second limit), and preserve raw-terminal input semantics. Report unchanged terminal buffers as the current screen, and fall back to Harbor token counting when model usage is absent. These fixes apply automatically to the existing Terminus agent configuration.
Preserve an exited shell's output and replace its PTY, discarding pending input and the remaining command batch. The model receives a notice describing the reset shell state and must confirm completion again. Task files and configured environment remain available. A missing tmux session fails explicitly. Shell replacement fails explicitly when terminal recording is enabled; the Gym agent already disables that recording.
Linux and live-sandbox reproductions cover blocked Ctrl-C, raw-terminal input, ordinary shell failure, and interrupts with
set -e, including 32,768 queued commands. They verify that recovery retains files without executing pending input. A real Harbor-loop regression verifies that the model sees the reset notice before confirming completion. Model smoke rollouts for this revision are pending; this remains a draft until their agent and verifier traces are inspected. The regression reproductions are included here, so a separate issue is unnecessary.