fix(opencode): allow pid 0 in Pty.Info for Windows ConPTY (#29828)

This commit is contained in:
Luke Parker
2026-05-29 13:47:50 +10:00
committed by GitHub
parent 031f82adc8
commit 29d17b9055
2 changed files with 38 additions and 1 deletions

View File

@@ -60,7 +60,11 @@ export const Info = Schema.Struct({
args: Schema.Array(Schema.String),
cwd: Schema.String,
status: Schema.Literals(["running", "exited"]),
pid: PositiveInt,
// Windows ConPTY (@lydell/node-pty >= 1.2.0-beta.12) assigns the child pid
// asynchronously, so `proc.pid` is 0 at the synchronous spawn point and only
// resolves a tick later. `create` snapshots it immediately, so 0 is a valid
// "pid not yet assigned" value here.
pid: NonNegativeInt,
}).annotate({ identifier: "Pty" })
export type Info = Types.DeepMutable<Schema.Schema.Type<typeof Info>>