Repository navigation
[Bug] Windows: cancelling a running shell tool call kills the dsh web host (console-wide CTRL_C) #7957
Replies: 1 comment
|
Follow-up from the reporter (one correction + confirmation). Correction: the host does install signal handlers — dsh/lib/profile-boot-*.js: Confirmation of the path: the model-facing So the question narrows to: should cancelling a tool call be able to look like an intentional user
Local mitigation we are testing meanwhile: a preload that captures the host's SIGINT listener and |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
On Windows 11 with dsh 0.1.5-rc.2 (the limitation is still documented in 0.1.7-rc.2), cancelling a
running shell tool call takes down the whole
dsh webhost:dsh web *>&1 | Tee-Object <log>, the log ends at startup with no error;while mid-sync), and the terminal returns to a prompt.
Repro: start
dsh webfrom a console → have the agent run a shell command → cancel that tool call→ the host exits.
My reading:
dsh-subprocess-localdelivers SIGINT on Windows as a\u0003write, which conhostturns into a console-wide CTRL_C (documented in its README under "Known Limitations"). The host is
started from that same console and the provider's tool session is its child, so the host receives
that CTRL_C as well. The same README notes that an application only covers the default signal
disposition by installing a handler — so: does the host install a
SIGINThandler? If not, thatwould explain the silent exit, and installing one (or starting the host detached from the shared
console) would fix it.
Impact: cancelling a tool call tears down in-flight agent sessions and plugin operations, and a
plugin performing a git sync leaves a stale lock directory behind (reproduced several times here).
Happy to test a build. Related: discussions/7531.
Technical details (source references and log evidence)
Source references (published packages):
@deepseek-ai/dsh-subprocess-locallib/runner-launch-*.js— Windows inspector returns the shellpid as the foreground process group:
foregroundPgid(shellPid) { return shellPid; }lib/index.jssignalForeground():if (signal === "SIGINT") { this.terminal.write("\u0003"); return foreground.processGroupId; }(only SIGKILL on the provider's own pid is refused: "refusing to SIGKILL the terminal shell")
delivered as a
\x03Ctrl-C input write that conhost turns into a console-wide CTRL_C event…"SIGINT, or SIGHUP bypasses that event; an application covers those signals only by installing a
handler that performs normal disposal or calls process.exit()."
Observed on this machine:
while a git sync was in flight;
powershell.exe) and the tool session is its child → same console;
resource-exhaustion event around those times → not an OS kill, not a native crash.
Suggested fix (host side): install a
SIGINThandler (dispose-then-exit, or ignore a console-wideCTRL_C that was not addressed to the host); alternatively start the host detached from the shared
console so console-wide CTRL_C cannot reach it.
All reactions