Skip to content

fix(background-terminals): avoid false success after Windows taskkill timeout - #412

Merged
tt-a1i merged 2 commits into
openpi-dev:mainfrom
627150795:codex/issue-408-taskkill-timeout
Sep 6, 2026
Merged

fix(background-terminals): avoid false success after Windows taskkill timeout#412
tt-a1i merged 2 commits into
openpi-dev:mainfrom
627150795:codex/issue-408-taskkill-timeout

Conversation

@627150795

@627150795 627150795 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #408. On Windows, a slow taskkill /T /F helper can exceed its bounded wait, get force-closed, and then fall back to child.kill(). That only terminates the shell and can orphan descendants while the manager reports successful termination.

Value

A timed-out tree kill is reported as unresolved instead of claiming that the full process tree was terminated. This keeps background-terminal state truthful and avoids silently leaving servers or descendants holding resources.

Approach

Treat every Windows taskkill timeout as unresolved, including the case where the helper closes after SIGKILL. Keep the existing time bounds, direct fallback behavior for non-timeout cases, and POSIX behavior unchanged. Cover both graceful and force timeouts, with the shell still alive or exiting during timeout. Every case stays unresolved and avoids a direct shell signal.

Validation

  • bun run check — passed.
  • Node 22 bun run test at a2c23a1 — 1427 passed, 1 skipped; Vitest 30 passed.
  • The first local full-suite run hit a 150ms subagent watchdog assertion in tests/extensions/subagents/manager.test.ts; its isolated rerun and a second complete suite passed.
  • Final-head Node 22, Node 24, and Windows CI must pass before merge.

Impact

  • User-visible behavior: uncertain Windows process-tree termination is surfaced as failure/unresolved rather than success.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: Windows background-terminal cleanup fails closed on taskkill timeout; POSIX behavior is unchanged.
  • Persisted config/data: none.
  • Compatibility/risk: a timed-out Windows kill remains unconfirmed and may leave processes running. This change prevents the shell-only timeout fallback; it does not implement a reliable retry or Windows Job Object containment.

@github-actions github-actions Bot added the area:background-terminals Background terminal runtime, skill, or tests label Sep 6, 2026
@tt-a1i
tt-a1i merged commit c1c60cd into openpi-dev:main Sep 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:background-terminals Background terminal runtime, skill, or tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

background-terminals: force-kill falls back to TerminateProcess(shell) when taskkill exceeds its 400ms budget, orphaning the process tree (Windows)

2 participants