Skip to content

Docs: a PATH-resolved launch on Windows runs through the npm shim (ProcessId, linger after a hard kill) #290

Closed

Description

@Blind-Striker

What

The default launch (no Command, so opencode is resolved from PATH) works on Windows against an npm-installed CLI. The SDK resolves the npm shim opencode.CMD and starts it through cmd.exe /d /s /c. Two things the guide does not say:

  • OpenCodeServer.ProcessId is the cmd.exe host, not the server. The server is a grandchild, beside conhost.
  • After the owning process is killed hard, the server outlives it until its stdin lease ends it: measured 0.0 s with no turn run, then 6.6 s and 9.3 s after a model turn.

The XML describes the mechanism, but the README and the guide, which both use the default launch, mention neither the delay nor what ProcessId identifies with a shim.

Also a nit: Command is non-nullable, so assigning null to mean "the default" raises CS8601; the default comes only from a fresh OpenCodeServerOptions.

Severity: minor. Found by the default-launch check on Windows (apps 01 and 02, global CLI 2.0.29).

Proposed

Document in the connection-modes guide, for a shim-resolved launch, what ProcessId identifies and how long the server can outlive an owner that was killed hard. Resolving an npm shim to its target executable would be an SDK-only change made for safety, and it would have to be weighed against the launcher's "resolve like a shell" contract. That is a separate decision and not part of this issue.

Source: internal DevEx evaluation of 0.9.0-preview.10, default-launch follow-up, 2026-10-14 (finding DX-24).

Activity

  1. Blind-Striker commented on Oct 15, 2026

    @Blind-Striker
    CollaboratorAuthor

    Correction from the DevEx web-dashboard round (2026-10-15). The guide already says that ProcessId is the cmd.exe host for a shim launch and that ServerInfo.Pid names the server, so that part of this issue was wrong. The real gap is narrower: the same note says "nothing else about the lifecycle changes", yet an owner that crashes leaves the real server alive for 6 to 9 s, until its stdin lease ends it (measured again in this round: 7.9 s). The fix is to reword that sentence to state the linger. The launcher's behaviour stays at upstream parity (#294 closed).

  2. added this to the 1.0 milestone on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions