Repository navigation
fix(webui): the native acceptance host goes when it is done - #17
Merged
UncleMoc merged 1 commit intoNov 10, 2026
Merged
Conversation
The native PTY case failed at random on Windows with an "afterAll" hook timeout. The cause was the host staying alive after it had finished. Node-pty's Windows console-list helper is forked on every terminal kill to enumerate the processes attached to the shell's console. A shell hosted by ConPTY has a pseudo-console rather than a console, so the helper's AttachConsole always fails there; the helper dies without answering, and node-pty falls back to a five-second timer to resolve the promise. That timer lives in the process that killed the terminal, so every kill left the process five seconds of work it had not asked for. Measured on this host: killing five terminals finished in 720ms, and the process still lived for 5.74s. The acceptance host has nothing left to do once it has reported, so it now exits there — in the send callback, which runs after the message has been flushed, so the report is not lost. The case went from 13-15 seconds to about 8.5. The case now says so: the host has to be gone within two seconds of reporting that it closed, and a shutdown that does not arrive carries the host's own trace of where it was. Before this, a timeout said only that the hook ran out of time; it now says which step stopped answering. The alternative — node-pty's useConptyDll option, which skips the helper entirely — was measured and is worse: the process did not exit at all.
Collaborator
Author
|
Ready to merge from my side — three-platform CI is green and this touches only I could not merge it myself: the account this branch belongs to ( |
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.
Change
The native PTY case failed at random on Windows with an
afterAllhook timeout. The cause was the acceptance host staying alive after it had finished.Node-pty's Windows console-list helper is forked on every terminal kill to enumerate the processes attached to the shell's console. A shell hosted by ConPTY has a pseudo-console rather than a console, so the helper's
AttachConsolealways fails there; the helper dies without answering, and node-pty falls back to a five-second timer to resolve the promise. That timer lives in the process that killed the terminal, so every kill left the host five seconds of work it had not asked for.Measured on a Windows host, killing five terminals: the real work finished in 720ms, and the process still lived for 5.74s — one
Error: AttachConsole failedper terminal, which is the line that shows up in the CI logs.The acceptance host now exits once it has reported, in the send callback, which runs after the message has been flushed, so the report is not lost. The case went from 13-15 seconds to about 8.5.
The case now says so as well: the host has to be gone within two seconds of reporting that it closed, and a shutdown that does not arrive carries the host's own trace of where it was. Before this, a timeout said only that the hook ran out of time; it now says which step stopped answering.
The alternative — node-pty's
useConptyDlloption, which skips the helper entirely — was measured and is worse: the process did not exit at all.Validation
the native host did not exit. Green after it.*-win32.pngbaselines, which fail the same way without this change on this host.check:source,typecheck,check:webui-motion,check:webui-overlaysandtest:release-toolspass.Publication and contribution checks
release/public-source.json; new tests are declared intest/vitest-suites.jsonwhere applicable.Maintainer handoff
Publication scope or license changes (if any): none.
Shared-source port: not needed / pending / complete. Record public PR references only; keep private links and review material out of this PR.
This follows #14, which is merged. The same five-second drag is in the product too: the desktop app lingers that long after closing the WebUI service with a terminal open, because node-pty's internal timer cannot be unref'd from outside. That is not addressed here.