Harden HTM sessions, add Windows support, and raise Unix coverage - #801
Merged
Conversation
Disconnects no longer hang or abort the daemon: SESSION_END is a 1-byte packet, unknown headers drop the connection instead of parsing a length, and closeEndpoint ignores write failures on a dead pipe. Unix pane shutdown closes the PTY master before reaping the child so a blocked shell cannot stall waitpid. Build htm/htmd on Windows with ConPTY and a detached htmd process, and link tests against HtmCommon. Add Catch2 coverage for IPC, multiplexer state, server/client protocol, and PTY lifecycle, plus PTY and iTerm2 end-to-end scripts. Fix the Codecov job for lcov 2.x, flush gcov from forked HtmClient tests, stop ignoring src/htm, and fail coverage.sh when Unix HTM line coverage is under 80%. Co-authored-by: Cursor <cursoragent@cursor.com>
…t-in. HtmClient used to block in writeAll on a backed-up leader PTY, so stdin (INSERT_KEYS) stalled and Hyper/iTerm dropped the session. Unix htm now queues daemon output and keystrokes, writes when the fds are writable, and treats SESSION_END as a packet-boundary 'D' so Base64 payloads cannot look like a close. Default ctest / ./et-test no longer run iTerm2, Ghostty, or Hyper e2e until those terminals' HTM PRs land. Invoke them by name: ./et-test ghostty python3 test/system_tests/iterm2_htm_e2e.py npm run test:system # hyper-htm repo Protocol coverage (htm_pty/features/stress e2e and Catch2 HtmClient/ HtmServer tests) still runs by default. Co-authored-by: Cursor <cursoragent@cursor.com>
…lity. Co-authored-by: Cursor <cursoragent@cursor.com>
…n/sh in tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #801 +/- ##
===========================================
- Coverage 87.14% 73.28% -13.86%
===========================================
Files 75 94 +19
Lines 6462 8614 +2152
Branches 610 5701 +5091
===========================================
+ Hits 5631 6313 +682
- Misses 831 1705 +874
- Partials 0 596 +596 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… Debian. Co-authored-by: Cursor <cursoragent@cursor.com>
…ll GCC via apt under act. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…t pgrep. ThreadSanitizer aborts after Catch2 reports those tests passed because forkpty runs on a worker thread. Fedora/Arch e2e crashed when pgrep was not installed. Co-authored-by: Cursor <cursoragent@cursor.com>
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
SESSION_END, ignore unknown headers instead of parsing a length, and do not aborthtmdwhen the client hangs up.htmd, and buildhtm/htmdon all platforms fromHtmCommon.src/htm, flush gcov from forkedHtmClienttests, and failcoverage.shif Unix HTM line coverage is under 80% (Windows/ConPTY branches are not compiled on that job).Test plan
pushd build; ninja && ctest --parallel --output-on-failure; popd(or./et-test '[Htm]')bash coverage.shand confirm HTM Unix line coverage ≥ 80%htm -xon macOS/Linux: split, new tab, type into a pane, close a pane, disconnect with Escape, shut down withxhtm/htmdstart a ConPTY session and survive client disconnectMade with Cursor