@giladbarnea/pi-simple-team 2.0.10 → 2.0.11

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.
Files changed (2) hide show
  1. package/child-tools.ts +6 -1
  2. package/package.json +1 -1
package/child-tools.ts CHANGED
@@ -65,8 +65,13 @@ function readRequiredChildRuntimeConfig(): ChildRuntimeConfig {
65
65
  };
66
66
  }
67
67
 
68
+ /**
69
+ * Main marks only the process it starts with PI_SIMPLE_TEAM_CHILD=1. That process claims the teammate identity for its PID, which
70
+ * survives Pi's in-process reloads and session replacements. Subprocesses inherit the environment, not the claim, so they run as main.
71
+ */
68
72
  export function readChildRuntimeConfig(): ChildRuntimeConfig | undefined {
69
- if (process.env.PI_SIMPLE_TEAM_CHILD !== "1") return undefined;
73
+ if (process.env.PI_SIMPLE_TEAM_CHILD === "1") process.env.PI_SIMPLE_TEAM_CHILD = String(process.pid);
74
+ if (process.env.PI_SIMPLE_TEAM_CHILD !== String(process.pid)) return undefined;
70
75
  return readRequiredChildRuntimeConfig();
71
76
  }
72
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giladbarnea/pi-simple-team",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "A flat, live team of Pi agents.",
5
5
  "keywords": [
6
6
  "pi-package",