{"record":{"id":"1bc115930b133076","repo":"paperclipai/paperclip","slug":"agent-reference-is-required","errorCode":null,"errorMessage":"Agent reference is required","messagePattern":"Agent reference is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/prompt.ts","lineNumber":250,"sourceCode":"    reason,\n    payload: { issueId },\n  });\n}\n\nfunction normalizePrompt(prompt: string): string {\n  const normalized = prompt.trim();\n  if (!normalized) throw new Error(\"Prompt text is required\");\n  return normalized;\n}\n\nfunction defaultPromptTitle(prompt: string): string {\n  const firstLine = prompt.split(/\\r?\\n/).map((line) => line.trim()).find(Boolean) ?? \"Prompt handoff\";\n  return firstLine.length > 100 ? `${firstLine.slice(0, 97)}...` : firstLine;\n}\n\nfunction assertAgentMatchesReference(agent: Agent, reference: string): void {\n  const normalized = reference.trim().toLowerCase();\n  if (!normalized) throw new Error(\"Agent reference is required\");\n  const matches = [\n    agent.id,\n    agent.name,\n    typeof agent.urlKey === \"string\" ? agent.urlKey : null,\n  ].some((value) => value?.toLowerCase() === normalized);\n  if (!matches) {\n    throw new Error(\n      `Agent key belongs to ${agent.name} (${agent.id}), not '${reference}'. Use the matching agent or a board prompt.`,\n    );\n  }\n}\n\nfunction agentSummary(agent: Agent): PromptResult[\"agent\"] {\n  return {\n    id: agent.id,\n    name: agent.name,\n    urlKey: typeof agent.urlKey === \"string\" ? agent.urlKey : null,\n  };","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/prompt.ts#L232-L268","documentation":"assertAgentMatchesReference got an empty normalized reference, so there is no agent identity to compare against the API-key owner.","triggerScenarios":"Thrown at cli/src/commands/client/prompt.ts:250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide an agent reference (name or ID)."],"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"}