ework-daemon 0.4.20 → 0.4.21

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/package.json +1 -1
  2. package/src/opencode.ts +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/src/opencode.ts CHANGED
@@ -960,6 +960,12 @@ export class Engine {
960
960
  stdin: "ignore",
961
961
  });
962
962
 
963
+ if (this.generation.get(k) !== gen) {
964
+ log.warn(`engine: spawned pid=${proc.pid} but generation superseded — killing orphan for ${k}`);
965
+ try { this.killProcessTree(proc.pid); } catch { /* already dead */ }
966
+ return;
967
+ }
968
+
963
969
  this.processes.set(k, proc);
964
970
  this.lastOutputAt.set(k, Date.now());
965
971
  if (!this.startedAt.has(k)) {