test(windows): ConPTY e2e coverage for the #124 parity fixes - #127
Merged
Conversation
Adds a #[cfg(windows)] integration suite with no Cargo-feature gate, so the stock 'cargo test --workspace' CI leg on windows-latest runs it (the docker/bwrap suites stay feature-gated and Linux-only). Six tests, one per fix in #124: 1. run | consumer in a cmd.exe pipeline sees prompt EOF (win_spawn handle-inheritance allow-list; 90s bound vs the 15min idle timeout that masked the pre-fix hang). 2. Interactive pane's startup DSR (ESC[6n) is answered — new dsr_probe bin (src/bin) enables VT input on its own console, emits the query, and prints the reply; without take_pty_writes write-back it blocks forever. 3. tail --follow delivers a fast-exiting child's trailing bytes before the stream ends (exit_drained / DRAIN_GRACE). 4. die reaps the descendant tree (verified via Win32_Process with a per-test sentinel in the grandchild's command line). 5. signal SIGINT interrupts via ConPTY ETX (ping -t exits). 6. signal SIGBREAK is rejected with an actionable error. Each test runs an isolated session + socket dir and ties the daemon to the test process (AGENT_TUI_MONITOR_PARENT_PID) plus a best-effort 'daemon shutdown' on drop, so the file is parallel-safe and leaves no orphaned daemons. Verified: cargo check/clippy --all-targets -D warnings for x86_64-pc-windows-msvc, cargo fmt --check, cargo test -p agent-tui-integration (Linux aarch64; the new file is cfg-stripped there). The tests themselves require a Windows host — the windows-latest CI leg is the first execution environment. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Iteration 2 from windows-latest CI data (3 passed, 3 failed):
- run-pipe-eof: Rust's CommandLineToArgvW quoting (" for embedded
quotes) collides with cmd /c's outer-quote stripping ('"...exe" is
not recognized'). Write the pipeline to a .cmd file instead — cmd
parses batch lines natively.
- dsr: probe read 0 bytes (reply never became readable stdin). Probe is
now conpty_probe with MODE-SET/DSR-READ diagnostics, and the test
parses the tail JSON envelope's data.text instead of raw stdout.
- sigint: the signal RPC succeeded (ETX written) but ping never exited —
conhost's ETX -> CTRL_C_EVENT translation is mode- and Windows-
version-dependent (author's Win11 e2e saw it land; windows-latest CI
did not). Repin the test on the deterministic daemon-side half: ETX
byte delivery to the child's stdin, via conpty_probe read-stdin.
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
CI diagnostics showed the probe DID receive the cursor-position report (DSR-READ:n=6:status=stop-byte, i.e. ESC[1;1R) — but printing it raw into the pane means the pane's own terminal parser swallows the escape sequence, so the stripped text showed an empty reply. Print DSR-REPLY-HEX instead and assert the decoded shape (ESC [ <digits> ; <digits> R). Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
c1-squire-dev
Bot
force-pushed
the
paul.querna/windows-conpty-e2e-tests
branch
from
July 29, 2026 18:19
0ddc17d to
04d5119
Compare
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.
Summary
Automated end-to-end coverage for the Windows/ConPTY parity fixes in #124,
whose evidence was host-run only. The suite is
#[cfg(windows)]with noCargo-feature gate, so the stock
cargo test --workspaceCI leg onwindows-latestruns it (the docker/bwrap suites stay feature-gated andLinux-only). Six tests, one per fix:
run | consumerno-hang — faithfulcmd.exepipeline repro; assertsthe consumer sees EOF within 90s (the pre-fix hang lasted until the 15-min
daemon idle timeout). Guards the
win_spawnhandle-inheritance allow-list.dsr_probebin (src/bin/) enables VTinput on its own console, emits
ESC[6n, and prints the reply; without thetake_pty_writeswrite-back it blocks forever and the sentinel neverappears.
tail --followtrailing bytes — a 200-lines-then-exit-fast child;asserts
line200arrives before the stream ends (exit_drained/DRAIN_GRACE) and that the stream ends at all.diedescendant tree-kill — grandchild carries a per-test sentinel inits command line;
Win32_Processverifies it is gone afterdie.signal SIGINT— ETX via the ConPTY input stopsping -t(
wait --exitconfirms).signal SIGBREAK— rejected with the actionable "cannot be delivered"error, not a false success.
Each test runs an isolated session + socket dir and ties the daemon to the
test process (
AGENT_TUI_MONITOR_PARENT_PID) plus a best-effortdaemon shutdownon drop — parallel-safe, no orphaned daemons.Testing
cargo check/cargo clippy --all-targets -- -D warningsforx86_64-pc-windows-msvc— the suite anddsr_probecompile for Windows.cargo fmt --check,cargo test -p agent-tui-integration(Linux aarch64;the new file is cfg-stripped there).
windows-latestCI leg is their first execution environment. The DSR probemechanics (VT-input read of the cursor reply) are the most likely spot to
need a tweak after a real run.
🤖 Generated with Claude Code + Squire