{"record":{"id":"0ac1a950172e9fae","repo":"paperclipai/paperclip","slug":"opencode-test-drives-require-model-openrouter-m","errorCode":null,"errorMessage":"OpenCode test drives require --model openrouter/<model>, with no empty path segments.","messagePattern":"OpenCode test drives require --model openrouter/<model>, with no empty path segments\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/test-drive.ts","lineNumber":250,"sourceCode":"  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    );\n  }\n\n  const sourceEnvName = options.apiKeyEnv?.trim() || definition.credentialTarget;\n  if (options.apiKeyEnv !== undefined && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(sourceEnvName)) {\n    throw new Error(\"--api-key-env must name a valid environment variable.\");\n  }\n  const credential = options.apiKey ?? env[sourceEnvName];\n  if (!credential || credential.trim().length === 0) {\n    throw new Error(\n      `No credential found. Set ${sourceEnvName}, pass --api-key-env <variable>, or pass --api-key <value>.`,\n    );\n  }\n\n  return {\n    ...definition,\n    companyName,","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/test-drive.ts#L232-L268","documentation":"resolveTestDriveBootstrap validates the --model option for the opencode harness. OpenCode test drives only support OpenRouter-hosted models, and the value must be of the form openrouter/<model> with one or more non-empty, non-whitespace path segments. This error means the passed model was missing or did not match that pattern.","triggerScenarios":"Running `paperclip test-drive --harness opencode` with no --model, with a model lacking the openrouter/ prefix (e.g. 'anthropic/claude-3'), with an empty segment (e.g. 'openrouter//foo' or 'openrouter/'), or with whitespace inside the value.","commonSituations":"Copying a model ID from another provider's docs that omits the openrouter/ prefix; pasting a value with a trailing slash; forgetting --model entirely because other harnesses infer a default model.","solutions":["Pass --model openrouter/<model-id>, e.g. --model openrouter/anthropic/claude-3.5-sonnet","Verify the exact model slug on OpenRouter and ensure no empty segments or whitespace","If the harness should not be opencode, pass the intended --harness value that matches your model format"],"exampleFix":"// before\npaperclip test-drive <app> --harness opencode --model anthropic/claude-3.5-sonnet\n// after\npaperclip test-drive <app> --harness opencode --model openrouter/anthropic/claude-3.5-sonnet","handlingStrategy":"validation","validationCode":"const m = model?.trim();\nif (harness === 'opencode' && !/^openrouter\\/[^/\\s]+(?:\\/[^/\\s]+)*$/.test(m ?? '')) {\n  throw new Error('opencode requires --model openrouter/<model>');\n}","typeGuard":"function isOpenRouterModel(v: unknown): v is string {\n  return typeof v === 'string' && /^openrouter\\/[^/\\s]+(?:\\/[^/\\s]+)*$/.test(v);\n}","tryCatchPattern":null,"preventionTips":["Always prefix opencode models with openrouter/","Copy model slugs directly from the OpenRouter catalog","Add a shell alias or wrapper that defaults --model for opencode harness"],"tags":["cli","validation","model-config"],"backgroundTag":"invalid-argument-format","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"}