{"record":{"id":"5e9d9105820afbdf","repo":"paperclipai/paperclip","slug":"setup-token-login-failed-the-sandbox-login-comman","errorCode":null,"errorMessage":"setup-token login failed: the sandbox login command errored.","messagePattern":"setup-token login failed: the sandbox login command errored\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapters/claude-local/src/server/setup-token-runner.ts","lineNumber":395,"sourceCode":"    }\n\n    // The command exited cleanly. Deliver the bound token through the mandatory\n    // sink and await it. The runner fails closed: a missing sink, a clean exit\n    // with no bound token, and a sink rejection each end the run as a failure. It\n    // reports success only after the sink resolves.\n    const delivered = await deliverCredential();\n    if (!delivered) {\n      log(\"[paperclip] Setup-token login: the credential did not land; treating the run as a failure.\");\n      return result(\"failure\", exitCode);\n    }\n    credentialDelivered = true;\n\n    log(\"[paperclip] Setup-token login command ended successfully.\");\n    return result(\"success\", exitCode);\n  } catch {\n    // Convert any driver error to a fixed, non-secret error. The original error\n    // may embed streamed bytes, so the runner never propagates its message.\n    throw new Error(\"setup-token login failed: the sandbox login command errored.\");\n  } finally {\n    if (signal) signal.removeEventListener(\"abort\", onExternalAbort);\n    // Zero any bound token bytes that the delivery path did not consume, so a\n    // timeout, a cancellation, or an error never leaves the secret in memory. The\n    // cast restores the type that the closure assignment widens away.\n    const leftover = tokenBytes as Buffer | null;\n    if (leftover) {\n      leftover.fill(0);\n      tokenBytes = null;\n    }\n    // Stop a pending code-input routine, then stop the child and dispose.\n    controller.abort();\n    await stopAndDispose(driver, log);\n  }\n}\n","sourceCodeStart":377,"sourceCodeEnd":411,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/packages/adapters/claude-local/src/server/setup-token-runner.ts#L377-L411","documentation":"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).","triggerScenarios":"Thrown at packages/adapters/claude-local/src/server/setup-token-runner.ts:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the setup-token login command manually to see the error, fix it, and retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}