garrytan/gstack · error · Error

sidecar-circuit-broken

Error message

sidecar-circuit-broken

What it means

Error "sidecar-circuit-broken" thrown in garrytan/gstack.

Source

Thrown at browse/src/security-sidecar-client.ts:186

  reason?: string;
}

export function isSidecarAvailable(): SidecarAvailability {
  const s = getState();
  if (s.brokenCircuit) return { available: false, reason: "circuit-broken" };
  if (s.child) return { available: true };
  // Probe via findSecuritySidecar without spawning. If the resolver returns
  // null (no node on PATH, no entry on disk), we're permanently unavailable
  // until a setup re-run.
  const location = findSecuritySidecar();
  if (!location) return { available: false, reason: "no-node-or-entry" };
  return { available: true };
}

export async function scanWithSidecar(text: string, opts?: { timeoutMs?: number }): Promise<{ verdict: unknown }> {
  const s = getState();
  if (s.brokenCircuit) {
    throw new Error("sidecar-circuit-broken");
  }
  if (Buffer.byteLength(text, "utf-8") > REQUEST_CAP_BYTES) {
    throw new Error("payload-too-large");
  }
  if (!s.child) {
    if (!spawnSidecar()) {
      throw new Error("sidecar-spawn-failed");
    }
  }
  const id = String(s.nextId++);
  const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;

  return new Promise((resolve, reject) => {
    const timer = setTimeout(() => {
      s.pending.delete(id);
      recordFailure();
      reject(new Error("sidecar-timeout"));
    }, timeoutMs);

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/security-sidecar-client.ts:186 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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