pi-crew 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -120,11 +120,18 @@ export interface SpawnBackgroundTeamRunResult {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export function buildBackgroundSpawnOptions(manifest: TeamRunManifest, logFd: number): SpawnOptions {
|
|
123
|
+
// NOTE: Do NOT set PI_CREW_PARENT_PID for the background runner.
|
|
124
|
+
// The background runner is a top-level worker spawned by the team tool.
|
|
125
|
+
// When the team tool finishes, its process exits, and the background runner
|
|
126
|
+
// would incorrectly detect a "dead parent" and self-terminate.
|
|
127
|
+
// Child workers spawned BY the background runner will have the background
|
|
128
|
+
// runner as their parent, so they correctly die when the runner exits.
|
|
129
|
+
const { PI_CREW_PARENT_PID: _, ...envWithoutParentPid } = process.env;
|
|
123
130
|
return {
|
|
124
131
|
cwd: manifest.cwd,
|
|
125
132
|
detached: true,
|
|
126
133
|
stdio: ["ignore", logFd, logFd],
|
|
127
|
-
env:
|
|
134
|
+
env: envWithoutParentPid,
|
|
128
135
|
windowsHide: true,
|
|
129
136
|
};
|
|
130
137
|
}
|