feat(python-runtime): package the Windows x64 dsh executable

Add node24-win-x64 as the only supported Windows runtime target and publish it as a py3-none-win_amd64 wheel containing the conventional dsh and ripgrep .exe payload names. Keep Windows ARM64 rejected explicitly so Python cannot claim a carrier that CI and release automation do not build.

Teach the pkg builder to require a native x64 Windows host, validate both node-pty ConPTY addons, copy @vscode's win32 ripgrep executable, and recognize pkg's .exe output. Extend runtime resolution, wheel staging, payload validation, and the preset closure check so the Windows-specific PowerShell plugins and sidecars fail loud when omitted.

The sidecar resolver now maps a packaged main.exe to main-rg.exe; focused TypeScript and Python tests cover that name, the win_amd64 manifest, x64-only host selection, complete wheel payload, ConPTY inventory, and platform-conditioned plugin closure.
This commit is contained in:
Tianyi Cui
2026-08-24 19:09:40 +08:00
parent f76a225a7d
commit ca0b21661e
18 changed files with 380 additions and 53 deletions
+37
View File
@@ -783,6 +783,43 @@ for line in sys.stdin:
assert client._proc is None
def test_client_close_allows_eof_quiescence_after_shutdown_response(tmp_path: Path) -> None:
script = tmp_path / "fake_runtime.py"
marker = tmp_path / "quiesced.txt"
script.write_text(
"""
import json
import os
from pathlib import Path
import sys
import time
for line in sys.stdin:
msg = json.loads(line)
if msg.get("method") == "initialize":
print(json.dumps({"jsonrpc": "2.0", "id": msg["id"], "result": {"serverInfo": {"name": "fake-dsh"}}}), flush=True)
elif msg.get("method") == "shutdown":
print(json.dumps({"jsonrpc": "2.0", "id": msg["id"], "result": {}}), flush=True)
time.sleep(0.05)
Path(os.environ["QUIESCED_MARKER"]).write_text("quiesced")
""".strip()
)
client = HarnessClient(
HarnessConfig(
_launch_args=(sys.executable, str(script)),
env={"QUIESCED_MARKER": str(marker)},
shutdown_timeout_seconds=1,
)
)
client.start()
client.initialize(provider="deepseek-official", cwd="/workspace", model="dsagent")
client.close()
assert marker.read_text() == "quiesced"
def test_initialize_failure_reaps_started_runtime(tmp_path: Path) -> None:
script = tmp_path / "rejecting_runtime.py"
script.write_text(