{"record":{"id":"289c9230d44dcf60","repo":"paperclipai/paperclip","slug":"invalid-expires-at-value-opts-expiresat","errorCode":null,"errorMessage":"Invalid --expires-at value: ${opts.expiresAt}","messagePattern":"Invalid --expires-at value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/token.ts","lineNumber":235,"sourceCode":"async function resolveAgent(api: { get<T>(path: string): Promise<T | null> }, companyId: string, agentRef: string): Promise<Agent> {\n  const trimmed = agentRef.trim();\n  if (!trimmed) throw new Error(\"Agent reference is required\");\n  if (/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(trimmed)) {\n    const agent = await api.get<Agent>(apiPath`/api/agents/${trimmed}`);\n    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":217,"sourceCodeEnd":245,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/token.ts#L217-L245","documentation":"resolveBoardKeyExpiresAt parsed --expires-at with new Date() and got an invalid date, so the expiry timestamp string is not valid ISO 8601.","triggerScenarios":"Thrown at cli/src/commands/client/token.ts:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid ISO-8601 date/time for --expires-at."],"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"}