[PR #351] [MERGED] fix(aenv): preserve queued input during recovery #371

Closed
opened 2026-10-29 14:22:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/351
Author: @Boulea7
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @yingdi-shan

Base: main ← Head: ln-cx/agentenv-36-terminal-input-20261009


📝 Commits (2)

  • 3fab007 fix(aenv): preserve queued input during recovery
  • 6379af9 test(aenv): require each recovery input in order

📊 Changes

2 files changed (+284 additions, -10 deletions)

View changed files

📝 crates/aenv/src/commands/connect.rs (+4 -10)
➕ crates/aenv/src/commands/connect/input_tests.rs (+280 -0)

📄 Description

What

Preserve input queued while a recovery SendInput RPC is in flight.

Why

The RPC sends one chunk, but its completion previously drained every later chunk from stdin. This could discard Ctrl-C and subsequent commands before they were sent.

Refs #36.

Scope and non-goals

Client recovery input only. The transport protocol and reconnect policy are unchanged.

Design and behavior changes

Remove the post-RPC drain and its unused receiver parameter. The existing serial input loop consumes the remaining chunks in FIFO order. Add regressions for success, RPC errors, timeouts, and Ctrl-C queued behind another input.

Compatibility and operations

  • Public API or generated protocol: unchanged.
  • Configuration or defaults: unchanged.
  • Snapshot manifest, artifact layout, or storage format: unchanged.
  • Upgrade and rollback: ordinary CLI replacement.
  • Host requirements, permissions, ports, or dependencies: unchanged.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests

Commands and results:

cargo fmt -p aenv -- --check
cargo clippy --locked --offline -p aenv --all-targets -- -D warnings
cargo test --locked --offline -p aenv --bin aenv

All checks passed; 114 CLI tests passed. The four new regressions fail on the base commit. Tests used a short temporary directory for Unix sockets.

Also exercised real envd PTY input through a forced TCP disconnect: the production watchdog entered recovery, output reconnection finished recovery, and Ctrl-C plus subsequent commands worked in the same shell.

Skipped checks and reasons: validation was limited to the affected CLI package and a standalone envd fixture; full-workspace and server proxy/VM integration were not run.

Risks and reviewer notes

Delivery of already-submitted input remains uncertain after a timeout or disconnect. This change preserves queued input without adding retries for those submitted bytes.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/351 **Author:** [@Boulea7](https://github.com/Boulea7) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `ln-cx/agentenv-36-terminal-input-20261009` --- ### 📝 Commits (2) - [`3fab007`](https://github.com/kvcache-ai/AgentENV/commit/3fab0071d97cb1862dbe70b282301a9ee6059655) fix(aenv): preserve queued input during recovery - [`6379af9`](https://github.com/kvcache-ai/AgentENV/commit/6379af9b95305b47712920edb08d9727f968fec0) test(aenv): require each recovery input in order ### 📊 Changes **2 files changed** (+284 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/aenv/src/commands/connect.rs` (+4 -10) ➕ `crates/aenv/src/commands/connect/input_tests.rs` (+280 -0) </details> ### 📄 Description ## What Preserve input queued while a recovery `SendInput` RPC is in flight. ## Why The RPC sends one chunk, but its completion previously drained every later chunk from stdin. This could discard Ctrl-C and subsequent commands before they were sent. ## Related issue Refs #36. ## Scope and non-goals Client recovery input only. The transport protocol and reconnect policy are unchanged. ## Design and behavior changes Remove the post-RPC drain and its unused receiver parameter. The existing serial input loop consumes the remaining chunks in FIFO order. Add regressions for success, RPC errors, timeouts, and Ctrl-C queued behind another input. ## Compatibility and operations - Public API or generated protocol: unchanged. - Configuration or defaults: unchanged. - Snapshot manifest, artifact layout, or storage format: unchanged. - Upgrade and rollback: ordinary CLI replacement. - Host requirements, permissions, ports, or dependencies: unchanged. ## Validation - [ ] `make fmt` - [ ] `make clippy` - [ ] `make test-unit` - [ ] Relevant Rust integration tests Commands and results: ```text cargo fmt -p aenv -- --check cargo clippy --locked --offline -p aenv --all-targets -- -D warnings cargo test --locked --offline -p aenv --bin aenv ``` All checks passed; 114 CLI tests passed. The four new regressions fail on the base commit. Tests used a short temporary directory for Unix sockets. Also exercised real envd PTY input through a forced TCP disconnect: the production watchdog entered recovery, output reconnection finished recovery, and Ctrl-C plus subsequent commands worked in the same shell. Skipped checks and reasons: validation was limited to the affected CLI package and a standalone envd fixture; full-workspace and server proxy/VM integration were not run. ## Risks and reviewer notes Delivery of already-submitted input remains uncertain after a timeout or disconnect. This change preserves queued input without adding retries for those submitted bytes. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:22:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#371
No description provided.