Skip to content

fix(web): terminate Windows PTYs without unsupported signals - #605

Merged
tt-a1i merged 3 commits into
openpi-dev:mainfrom
outlier27-cell:fix/windows-pty-signal-free
Sep 22, 2026
Merged

tt-a1i merged 3 commits into
openpi-dev:mainfrom
outlier27-cell:fix/windows-pty-signal-free

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

On Windows, node-pty terminates through ConPTY and rejects POSIX signal arguments. The Web interactive terminal manager passed SIGKILL on force cleanup, and scheduled a POSIX force-kill fallback after normal cleanup.

Value

Windows Web terminals can close, be retained, and be disposed without throwing from node-pty. This prevents terminal lifecycle cleanup from failing on Windows while preserving the existing POSIX escalation behavior.

Approach

Use signal-free pty.kill() on Windows and keep the existing SIGKILL escalation only on non-Windows platforms. Add Windows-specific fake-PTY coverage for close, retain, and dispose, plus a native Windows PTY exit test.

Validation

  • bun run check passed.
  • node --experimental-strip-types --test tests/web/interactive-terminal.test.ts: 7/7 passed on Windows.
  • git diff --check passed.
  • Full bun run test was not rerun for this isolated two-file change; the repository baseline has unrelated post-edit lifecycle failures documented in PR fix(setup): recover locks while writers wait #604.

Impact

  • User-visible behavior: Windows Web terminal cleanup now completes reliably.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: Windows PTYs use the native signal-free termination API; POSIX escalation is unchanged.
  • Persisted config/data: none.
  • Compatibility or risk: change is limited to Windows PTY cleanup and its tests.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审提交 819d790083cccee8ff662e1a318598c6b32fb480

未发现阻断问题。Windows 路径改为 ConPTY 支持的无信号 pty.kill(),并只在 POSIX 保留延迟 SIGKILL 升级;close、retain、dispose 的 fake PTY 用例和原生 Windows PTY 退出用例覆盖了各条清理路径。当前 Node、Web E2E 和原生 Windows 检查均通过。

验证边界:没有重新执行长期运行的真实交互终端压力测试;结论覆盖本 PR 的两文件生命周期变化。

@tt-a1i
tt-a1i merged commit e5a1adc into openpi-dev:main Sep 22, 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.

2 participants