{"record":{"id":"63d6ecc786baa0c6","repo":"paperclipai/paperclip","slug":"unsupported-test-drive-harness-string-harness","errorCode":null,"errorMessage":"Unsupported test-drive harness: ${String(harness)}.","messagePattern":"Unsupported test-drive harness: (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/test-drive.ts","lineNumber":234,"sourceCode":"    throw new Error(\n      \"test-drive cannot reuse a data directory configured for an external PostgreSQL database. \" +\n        \"Choose a fresh data directory or change database.mode to embedded-postgres.\",\n    );\n  }\n}\n\nexport function resolveTestDriveBootstrap(\n  options: TestDriveOptions,\n  env: NodeJS.ProcessEnv = process.env,\n): ResolvedTestDriveBootstrap {\n  if (options.apiKey !== undefined && options.apiKeyEnv !== undefined) {\n    throw new Error(\"--api-key and --api-key-env are mutually exclusive.\");\n  }\n\n  const harness = options.harness ?? \"claude\";\n  const definition = HARNESS_DEFINITIONS[harness];\n  if (!definition) {\n    throw new Error(`Unsupported test-drive harness: ${String(harness)}.`);\n  }\n\n  const companyName = (options.companyName ?? \"Test Company\").trim();\n  const agentName = (options.agentName ?? \"CEO\").trim();\n  if (!companyName) throw new Error(\"--company-name cannot be empty.\");\n  if (!agentName) throw new Error(\"--agent-name cannot be empty.\");\n\n  const model = options.model;\n  if (model !== undefined && (!model || model.trim() !== model)) {\n    throw new Error(\"--model cannot be empty or have surrounding whitespace.\");\n  }\n  if (\n    harness === \"opencode\" &&\n    (!model || !/^openrouter\\/[^/\\s]+(?:\\/[^/\\s]+)*$/.test(model))\n  ) {\n    throw new Error(\n      \"OpenCode test drives require --model openrouter/<model>, with no empty path segments.\",\n    );","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/test-drive.ts#L216-L252","documentation":"After warm-transition recovery converges (identity matched, transition cleared), the transport verifies that the warm-recovery command actually completed by checking `core.getCommand(warmRecovery.commandId)?.status !== \"completed\"`. If the command is missing, pending, or failed, the transition result cannot be proven and this error is thrown.","triggerScenarios":"The recovery command referenced by `warmRecovery.commandId` has any status other than \"completed\" (including `undefined` — command record not found) after the identity wait loop succeeds.","commonSituations":"The command record was evicted/pruned from the store before being checked; the command failed but the identity still converged; a race where status is read too early because polling conditions passed on a stale snapshot.","solutions":["Check runnerd logs for the fate of the recovery command (did it fail or get dropped?) and fix the root cause before retrying the transition.","Ensure command records are retained in the store until the transition completes.","Re-run the warm transition so a fresh recovery command is issued and completes."],"exampleFix":"// before\n// command lost; treat as fatal\nif (core.getCommand(id)?.status !== \"completed\") throw ...;\n// after\nconst cmd = core.getCommand(id);\nif (cmd?.status !== \"completed\") {\n  await retryWarmTransition(root, desiredIdentity); // re-issue command\n}","handlingStrategy":"retry","validationCode":"const cmd = core.getCommand(warmRecovery.commandId);\nif (!cmd) throw new Error(\"recovery command record missing — cannot verify warm transition\");","typeGuard":"function isCompleted(cmd: { status?: string } | undefined): cmd is { status: \"completed\" } {\n  return cmd?.status === \"completed\";\n}","tryCatchPattern":"try {\n  await transport.startTurn(input);\n} catch (e) {\n  if (e.message === \"native_runner_warm_transition_result_unproven\") {\n    await retryWarmTransition(root, desiredIdentity); // re-issue the recovery command\n  }\n}","preventionTips":["Retain command records in the store until transitions complete.","Alert on failed recovery commands in runnerd logs.","Re-issue rather than assume success when the command status is unknown."],"tags":["runner","warm-transition","command"],"backgroundTag":"internal-invariant-violation","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"}