paperclipai/paperclip · error

setup-token login failed: the sandbox login command errored.

Error message

setup-token login failed: the sandbox login command errored.

What it means

Fail-closed outcome of the setup-token login runner: the sandboxed login command itself exited with an error before any credential could be read, so no token is delivered to the credential sink and the run is marked a failure (the runner only reports success after the sink resolves).

Source

Thrown at packages/adapters/claude-local/src/server/setup-token-runner.ts:395

    }

    // The command exited cleanly. Deliver the bound token through the mandatory
    // sink and await it. The runner fails closed: a missing sink, a clean exit
    // with no bound token, and a sink rejection each end the run as a failure. It
    // reports success only after the sink resolves.
    const delivered = await deliverCredential();
    if (!delivered) {
      log("[paperclip] Setup-token login: the credential did not land; treating the run as a failure.");
      return result("failure", exitCode);
    }
    credentialDelivered = true;

    log("[paperclip] Setup-token login command ended successfully.");
    return result("success", exitCode);
  } catch {
    // Convert any driver error to a fixed, non-secret error. The original error
    // may embed streamed bytes, so the runner never propagates its message.
    throw new Error("setup-token login failed: the sandbox login command errored.");
  } finally {
    if (signal) signal.removeEventListener("abort", onExternalAbort);
    // Zero any bound token bytes that the delivery path did not consume, so a
    // timeout, a cancellation, or an error never leaves the secret in memory. The
    // cast restores the type that the closure assignment widens away.
    const leftover = tokenBytes as Buffer | null;
    if (leftover) {
      leftover.fill(0);
      tokenBytes = null;
    }
    // Stop a pending code-input routine, then stop the child and dispose.
    controller.abort();
    await stopAndDispose(driver, log);
  }
}

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Run the setup-token login command manually to see the error, fix it, and retry.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/adapters/claude-local/src/server/setup-token-runner.ts:434 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/5e9d9105820afbdf. Report an issue: GitHub.