garrytan/gstack · error

Timed out waiting for concurrent daemon spawn

Error message

Timed out waiting for concurrent daemon spawn

What it means

Error "Timed out waiting for concurrent daemon spawn" thrown in garrytan/gstack.

Source

Thrown at design/src/daemon-client.ts:143

  }

  // Spawn under exclusive lock; re-read state INSIDE the lock so we don't
  // race a concurrent CLI that won the lock first.
  const lockPath = resolveLockFilePath(stateFile);
  const release = acquireLock(lockPath);
  if (!release) {
    // Another process is starting the daemon. Wait for it.
    log(verbose, "another CLI is spawning the daemon; waiting…");
    const start = Date.now();
    while (Date.now() - start < MAX_START_WAIT_MS) {
      const fresh = readStateFile(stateFile);
      if (fresh) {
        const h = await healthCheck(fresh.port);
        if (h) return { port: fresh.port, version: h.version, spawned: false };
      }
      await delay(POLL_INTERVAL_MS);
    }
    throw new Error("Timed out waiting for concurrent daemon spawn");
  }

  try {
    // Re-read under lock. Another caller may have already finished spawning
    // between our first check and our lock acquisition.
    const fresh = readStateFile(stateFile);
    if (fresh) {
      const h = await healthCheck(fresh.port);
      if (h && h.version === expectedVersion) {
        log(verbose, `another CLI won the lock; attaching pid=${fresh.pid} port=${fresh.port}`);
        return { port: fresh.port, version: h.version, spawned: false };
      }
    }

    log(verbose, "spawning new daemon");
    const port = await spawnDaemon({
      script: opts.daemonScript,
      env: { ...opts.daemonEnv, DESIGN_DAEMON_STATE_FILE: stateFile },

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at design/src/daemon-client.ts:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/66dd589735882d29. Report an issue: GitHub.