{"record":{"id":"ad7572aaab4c44e1","repo":"paperclipai/paperclip","slug":"redacted-error-message-from-test-drive-bootstrap","errorCode":null,"errorMessage":"<redacted error message from test-drive bootstrap>","messagePattern":"<redacted error message from test-drive bootstrap>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/test-drive.ts","lineNumber":478,"sourceCode":"        if (linkedWorktree) {\n          p.log.success(\"Run tasks in this worktree is enabled for this instance.\");\n        }\n\n        const url = dashboardUrl(server);\n        if (options.browser === false) {\n          p.log.success(`Paperclip is ready at ${pc.cyan(url)}.`);\n          return;\n        }\n        const opened = await dependencies.openBrowser(url);\n        if (opened) {\n          p.log.success(`Paperclip is ready and opened at ${pc.cyan(url)}.`);\n        } else {\n          p.log.warn(`Paperclip is ready, but the browser could not be opened. Visit ${url}.`);\n        }\n      },\n    });\n  } catch (error) {\n    throw new Error(redactTestDriveText(errorMessage(error), possibleCredentials), { cause: error });\n  }\n}\n\nexport function registerTestDriveCommand(program: Command): void {\n  program\n    .command(\"test-drive\")\n    .description(\"Start an isolated, initialized Paperclip instance for manual testing\")\n    .option(\"-d, --data-dir <path>\", \"Paperclip data directory to create or reuse\")\n    .option(\"--company-name <name>\", \"Initial company name\", \"Test Company\")\n    .option(\"--agent-name <name>\", \"Initial CEO agent name\", \"CEO\")\n    .addOption(\n      new Option(\"--harness <harness>\", \"Initial agent harness\")\n        .choices(TEST_DRIVE_HARNESSES)\n        .default(\"claude\"),\n    )\n    .option(\"--model <model-id>\", \"Initial agent model\")\n    .addOption(\n      new Option(\"--api-key-env <variable>\", \"Read the provider key from an environment variable\")","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/test-drive.ts#L460-L496","documentation":"testDriveCommand wraps the whole test-drive bootstrap/serving flow and rewrites any thrown error through redactTestDriveText, scrubbing any of the app's possibleCredentials from the message before surfacing it. This generic wrapper means the visible message is the underlying bootstrap error with credential substrings removed, and the original error is attached as `cause`.","triggerScenarios":"Any failure inside testDriveCommand's try block — bootstrap failures, API errors, server startup errors — is caught and re-thrown as this redacted error.","commonSituations":"Seeing a redacted/unhelpful message because the credential redactor replaced part of the underlying error text; debugging a test-drive failure and needing the root cause.","solutions":["Inspect error.cause (e.g. print `err.cause` in a debugger or enable verbose logging) for the original message","Fix the underlying bootstrap error (missing credential, invalid --model, arming failure, etc.)","Re-run with the credential correctly set so the redactor has nothing to mask"],"exampleFix":"// debugging\ncatch (e) { console.error(e.message); console.error('cause:', e.cause); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await testDriveCommand(opts);\n} catch (e) {\n  if (e.cause) console.error('root cause:', (e.cause as Error).message);\n  else throw e;\n}","preventionTips":["Always inspect error.cause — the top message may be redacted","Log full error chains (cause chain) in debug mode","Keep credentials out of config values you don't want redacted from messages"],"tags":["cli","error-handling","redaction"],"backgroundTag":"api-error-response","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}