orchestrating 0.1.31 → 0.1.32

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/bin/orch +10 -0
  2. package/package.json +1 -1
package/bin/orch CHANGED
@@ -249,6 +249,7 @@ async function handleDaemon(projectsDir) {
249
249
 
250
250
  let reconnecting = false;
251
251
  const recentRequests = new Set();
252
+ const recentSpawns = new Map(); // "command:cwd" -> timestamp
252
253
 
253
254
  function scheduleReconnect(delaySec) {
254
255
  if (reconnecting) return;
@@ -336,6 +337,15 @@ async function handleDaemon(projectsDir) {
336
337
  recentRequests.add(requestId);
337
338
  setTimeout(() => recentRequests.delete(requestId), 30_000);
338
339
 
340
+ // Dedup: prevent spawning same command in same directory within 10s
341
+ const spawnKey = `${cmd}:${(cmdArgs || []).join(",")}:${cwd || ""}`;
342
+ const lastSpawn = recentSpawns.get(spawnKey);
343
+ if (lastSpawn && Date.now() - lastSpawn < 10_000) {
344
+ process.stderr.write(`${DIM}${PREFIX} Ignoring duplicate spawn: ${spawnKey}${RESET}\n`);
345
+ return;
346
+ }
347
+ recentSpawns.set(spawnKey, Date.now());
348
+
339
349
  const cmdStr = [cmd, ...cmdArgs].join(" ");
340
350
  process.stderr.write(`${GREEN}${PREFIX} Spawning: ${cmdStr}${RESET}\n`);
341
351
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchestrating",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "Stream terminal sessions to the orchestrat.ing dashboard",
5
5
  "type": "module",
6
6
  "bin": {