{"record":{"id":"09b505abcae2221c","repo":"paperclipai/paperclip","slug":"invalid-ttl-days-value-opts-ttldays","errorCode":null,"errorMessage":"Invalid --ttl-days value: ${opts.ttlDays}","messagePattern":"Invalid --ttl-days value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/token.ts","lineNumber":240,"sourceCode":"    if (!agent || agent.companyId !== companyId) throw new Error(`Agent not found: ${agentRef}`);\n    return agent;\n  }\n  const query = new URLSearchParams({ companyId });\n  const agent = await api.get<Agent>(`${apiPath`/api/agents/${trimmed}`}?${query.toString()}`);\n  if (!agent || agent.companyId !== companyId) throw new Error(`Agent not found: ${agentRef}`);\n  return agent;\n}\n\nfunction resolveBoardKeyExpiresAt(opts: BoardTokenOptions): Date | null | undefined {\n  if (opts.neverExpires) return null;\n  if (opts.expiresAt?.trim()) {\n    const date = new Date(opts.expiresAt.trim());\n    if (!Number.isFinite(date.getTime())) throw new Error(`Invalid --expires-at value: ${opts.expiresAt}`);\n    return date;\n  }\n  if (opts.ttlDays?.trim()) {\n    const days = Number(opts.ttlDays);\n    if (!Number.isFinite(days) || days <= 0) throw new Error(`Invalid --ttl-days value: ${opts.ttlDays}`);\n    return new Date(Date.now() + Math.floor(days * 24 * 60 * 60 * 1000));\n  }\n  return undefined;\n}\n","sourceCodeStart":222,"sourceCodeEnd":245,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/token.ts#L222-L245","documentation":"resolveBoardKeyExpiresAt parsed --ttl-days as a number and it was not a positive integer, so the expiry offset is invalid.","triggerScenarios":"Thrown at cli/src/commands/client/token.ts:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a positive integer number of days for --ttl-days."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}