Review feedback: DAP thread IDs are scoped per client session, so deduping
the tree-wide thread list by (id, name) collapsed distinct threads that
different children happen to share — e.g. multiple identical worker scripts
each exposing { id: 1, name: "worker.js" }. Key the dedupe set by the owning
session id + thread id instead, so every live thread is preserved and only an
exact repeat within a single session's response is dropped.
Fixes#6663
Review feedback: classifying every root-with-a-live-child as a threadless
launcher dropped the root from thread aggregation, so a custom TCP adapter
whose root process owns threads and also issues startDebugging would have its
threads omitted. Drop the launcher heuristic: threads now fans out across all
live sessions in the tree and merges results. A genuinely threadless launcher
simply returns no threads (or an error we skip), so no topology guess is made.
Fixes#6663
js-debug launches are session trees: a threadless root launcher spawns
child sessions (main script, [worker N]) via reverse startDebugging. Every
stateful command routed through a single #activeSessionId set on the last
registration or stop, so a worker attaching after the script stopped stole
focus. threads listed only the worker, post-launch breakpoints read back as
unbound, and step/continue/evaluate could not target the script thread.
Focus now follows stops, not registrations: a new session claims the active
pointer only when no live, stopped session already holds it. threads
aggregates every live thread across the tree, skipping the threadless
launcher while real children are alive.
Fixes#6663
When the active js-debug child exits or terminates while other tree
sessions remain alive, #activeSessionId pointed at the dead child and
every subsequent tool action failed. Reassign to a live tree session
(preferring stopped, then non-root) on exited/terminated/proc-exit.
Regression test proves threads route to the surviving session.
Added TCP server transport for vscode-js-debug and recursively handled startDebugging requests, breakpoint synchronization, active child routing, and tree cleanup.
Fixes#5984