Skip to content

fix(dsh-plugin): bound output draining after child exit - #278

Merged
iuyo5678 merged 1 commit into
mainfrom
iuyo5678/fix-runner-exit-drain
Sep 18, 2026
Merged

iuyo5678 merged 1 commit into
mainfrom
iuyo5678/fix-runner-exit-drain

Conversation

@iuyo5678

Copy link
Copy Markdown
Collaborator

When a bsk child exits without emitting close, the plugin keeps waiting even after its command timeout: cancellation sees an exited process and cannot settle the pending run. A successfully created browser session can consequently remain absent from the plugin registry.

Allow one second to drain trailing stdout/stderr after exit, then release the remaining pipes and complete with the observed exit code and cancellation state. Normal close still completes immediately, and the existing cooperative cancellation and force-kill grace periods are preserved. Shared settlement cleanup clears all timers and prevents late events from completing a run twice.

Validation:

  • Added 14 lifecycle regressions across the Windows and POSIX code paths; 10 failed against main before the fix.
  • All 254 plugin tests, TypeScript checks, formatting checks, and the production build/pack passed.
  • Windows 11, Node 24.19.0, dsh 0.1.5-rc.2, bsk/daemon/Edge extension 0.3.0: the installed fixed package passed 5/5 normal session start/list/stop cycles.
  • In a real ConPTY dsh host, deliberately withholding the plugin children's close events still allowed 5/5 complete tool-pipeline start/list/stop cycles (1.40–1.65 seconds for start). Under the same injected condition, the unmodified npm package remained pending and its session list was empty.
  • A short-timeout fault-injection case now returns its timeout error. Test-created browser sessions and temporary dsh hosts were cleaned up.

Refs #180. This fixes the confirmed missing-close completion gap; it does not claim that Windows or ConPTY naturally loses the event. Scope is limited to the runner and its regression tests.

@iuyo5678
iuyo5678 merged commit d1356fd into main Sep 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant