You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] Windows: the auto-spawned daemon dies with the launching process tree (daemon start / status), and read-only commands start it as a side effect #268
Host: DeepSeek Harness Desktop. Shell commands are invoked with a fixed per-call timeout, stdout captured through a pipe (no TTY); on timeout the harness kills the command's whole process tree.
bsk daemon startnever returns in that context. When the harness kills the command at its 120 s timeout, the daemon dies with it — even though bsk daemon start --help says "Start the daemon (auto-detaches unless --foreground)".
bsk status behaves the same way, and it starts a daemon as a side effect: run while no daemon was alive, it printed a complete status block (daemon version 0.2.1, pid 25900, uptime 0s) and then hung; the harness killed it 90 s later — after which that daemon never logged again either.
So a caller that merely checks status can silently remove a healthy daemon. In agent harnesses that is a footgun rather than an edge case, because status / doctor are the first commands an agent runs (#265 and #24 report the unbounded wait; this is the side-effect half of it). The result: an unrelated later browser_session start has to auto-spawn a daemon, hits #180 / #183, hangs forever, and leaves the orphaned Agent Window of #245.
Evidence (~/.bsk/daemon.log.2026-09-17, UTC; local = UTC+8)
27604 was started by my bsk daemon start; the harness killed that command at its 120 s timeout and the daemon stopped logging at the same moment. Inferred: it died with its launcher.
25900 was started implicitly by bsk status (the command that only meant to report); the harness killed it at its 90 s timeout and it likewise never logged again. Inferred: same cause.
18152 was auto-spawned by the browser extension / plugin. Its parent exited normally, so it became an orphan — this is the only one that survived (still running hours later).
No daemon exit is logged (no shutdown line, no reason), which is what makes this hard to diagnose from the outside.
Expected behavior (suggested)
Either detach for real, or refuse. If the spawned daemon cannot survive the launcher (DETACHED_PROCESS / CREATE_NEW_PROCESS_GROUP, and on Windows CREATE_BREAKAWAY_FROM_JOB so a job-object kill of the caller cannot take it down), daemon start should fail fast with a message pointing at bsk daemon start --foreground (the pattern docs: clarify remote setup and persistent daemon startup #263 documents for persistent host tasks). The current middle ground — appears detached, then dies silently — is the worst case: the caller has no way to notice.
daemon start should be idempotent and return immediately when a healthy daemon is already running; today it blocks in agent contexts even though the daemon is up.
Read-only commands should not auto-start a daemon (status, doctor, browsers), or should behave as BSK_AUTO_START=0 when stdout is not a TTY. Starting a service as a side effect of a query is what makes agents kill daemons by accident.
Log a reason when the daemon exits (parent-killed / signal / idle). Diagnosing this from timestamps alone cost me a while; a single line would have made it obvious.
Do not run bsk daemon start / bsk status from a shell tool that kills its process tree on timeout. Read-only liveness probing that never starts anything: bsk browsers, or the owner of TCP port 52800.
Environment
bskCLI / daemon: 0.2.1 (daemon protocol 1.1),~/.local/bin/bsk.exe,BSK_HOME=~/.bsk@wxg-prc-cpg/browser-skill-dsh-plugin0.2.1Actual behavior
bsk daemon startnever returns in that context. When the harness kills the command at its 120 s timeout, the daemon dies with it — even thoughbsk daemon start --helpsays "Start the daemon (auto-detaches unless--foreground)".bsk statusbehaves the same way, and it starts a daemon as a side effect: run while no daemon was alive, it printed a complete status block (daemon version 0.2.1,pid 25900,uptime 0s) and then hung; the harness killed it 90 s later — after which that daemon never logged again either.So a caller that merely checks status can silently remove a healthy daemon. In agent harnesses that is a footgun rather than an edge case, because
status/doctorare the first commands an agent runs (#265 and #24 report the unbounded wait; this is the side-effect half of it). The result: an unrelated laterbrowser_session starthas to auto-spawn a daemon, hits #180 / #183, hangs forever, and leaves the orphaned Agent Window of #245.Evidence (
~/.bsk/daemon.log.2026-09-17, UTC; local = UTC+8)Only lines that are actually in the log:
How to read it (inferences, marked as such):
27604was started by mybsk daemon start; the harness killed that command at its 120 s timeout and the daemon stopped logging at the same moment. Inferred: it died with its launcher.25900was started implicitly bybsk status(the command that only meant to report); the harness killed it at its 90 s timeout and it likewise never logged again. Inferred: same cause.18152was auto-spawned by the browser extension / plugin. Its parent exited normally, so it became an orphan — this is the only one that survived (still running hours later).cgyais the session created during a 40-minute hang ofbrowser_session start(see [Bug][dsh-plugin] browser_session start hangs forever on Windows - bsk child exits fine, but plugin close event never fires; its own 120s timeout never surfaces #180 / [Bug][dsh-plugin] start 未返回时残留无人认领的 Agent Window,DSH 侧任何路径都关不掉它 | unregistered Agent Window orphaned by a non-returning browser_session start #245); the daemon idle-reaped it after 5 minutes.No daemon exit is logged (no shutdown line, no reason), which is what makes this hard to diagnose from the outside.
Expected behavior (suggested)
DETACHED_PROCESS/CREATE_NEW_PROCESS_GROUP, and on WindowsCREATE_BREAKAWAY_FROM_JOBso a job-object kill of the caller cannot take it down),daemon startshould fail fast with a message pointing atbsk daemon start --foreground(the pattern docs: clarify remote setup and persistent daemon startup #263 documents for persistent host tasks). The current middle ground — appears detached, then dies silently — is the worst case: the caller has no way to notice.daemon startshould be idempotent and return immediately when a healthy daemon is already running; today it blocks in agent contexts even though the daemon is up.status,doctor,browsers), or should behave asBSK_AUTO_START=0when stdout is not a TTY. Starting a service as a side effect of a query is what makes agents kill daemons by accident.parent-killed/signal/idle). Diagnosing this from timestamps alone cost me a while; a single line would have made it obvious.Related
~/.bsk/daemon.log), but the process-lifetime half is not.bsk doctorhangs indefinitely when no browser extension is connected (Windows, agent context) #265, fix: resolve CLI hanging issues in bsk status --json command #24 — unbounded waits indoctor/status --jsonwhen auto-start happens.Workaround (verified on 0.2.1)
Let the extension/plugin start the daemon (its spawner exits normally, so the daemon survives as an orphan), or start it fully detached:
Do not run
bsk daemon start/bsk statusfrom a shell tool that kills its process tree on timeout. Read-only liveness probing that never starts anything:bsk browsers, or the owner of TCP port 52800.