{"record":{"id":"bb96b30aba6e6acd","repo":"stablyai/orca","slug":"hermes-cron-requires-a-prompt","errorCode":null,"errorMessage":"Hermes cron requires a prompt.","messagePattern":"Hermes cron requires a prompt\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/automations/external-manager.ts","lineNumber":420,"sourceCode":"      return 'rm'\n  }\n}\n\nfunction normalizeHermesCronMutationInput(input: ExternalAutomationCreateInput): {\n  name: string\n  prompt: string\n  schedule: string\n  workdir: string | null\n} {\n  if (input.provider !== 'hermes') {\n    throw new Error('Only Hermes cron creation and editing are supported.')\n  }\n  const name = input.name.trim()\n  const prompt = input.prompt.trim()\n  const schedule = input.schedule.trim()\n  const workdir = input.workdir?.trim() || null\n  if (!prompt) {\n    throw new Error('Hermes cron requires a prompt.')\n  }\n  if (!schedule) {\n    throw new Error('Hermes cron requires a schedule.')\n  }\n  return {\n    name: name || prompt.slice(0, 50).trim() || 'Hermes cron',\n    prompt,\n    schedule,\n    workdir\n  }\n}\n\nfunction hermesCronCreateArgs(input: {\n  name: string\n  prompt: string\n  schedule: string\n  workdir: string | null\n}): string[] {","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/automations/external-manager.ts#L402-L438","documentation":"Thrown by normalizeHermesCronMutationInput() after trimming when input.prompt is empty. A Hermes cron job runs a prompt on a schedule, so a non-empty prompt is mandatory. The guard fires only for create/edit of Hermes crons (provider check at 756 runs first).","triggerScenarios":"Creating or editing a Hermes cron with a blank/whitespace-only prompt field; a form that submits an empty prompt; a script defaulting prompt to '' or undefined.","commonSituations":"User clicks create without entering a prompt; a template failed to interpolate and produced an empty string; UI sends the field as undefined which trims to ''.","solutions":["Require and validate a non-empty prompt in the UI/form before submitting create/update.","Coerce undefined to '' explicitly and show a validation error rather than calling the API.","For programmatic callers, assert input.prompt.trim() is non-empty upstream."],"exampleFix":"// before\ncreateExternalAutomation({ provider: 'hermes', prompt: '   ', schedule: '0 * * * *', ... }) // throws\n\n// after\nconst prompt = rawPrompt.trim()\nif (!prompt) throw new UserError('Prompt is required.')\ncreateExternalAutomation({ provider: 'hermes', prompt, schedule: '0 * * * *', ... })","handlingStrategy":"validation","validationCode":"function isNonEmptyPrompt(v: unknown): boolean {\n  return typeof v === 'string' && v.trim().length > 0\n}\n\nif (input.provider === 'hermes' && !isNonEmptyPrompt(input.prompt)) {\n  throw new UserError('Hermes cron needs a prompt.')\n}\ncreateExternalAutomation(input)","typeGuard":"function isNonEmptyString(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":"try {\n  await createExternalAutomation(input)\n} catch (e) {\n  if ((e as Error).message === 'Hermes cron requires a prompt.') {\n    throw new UserError('Please enter a prompt for the cron job.')\n  }\n  throw e\n}","preventionTips":["Require the prompt field in the create/edit form and disable submit until non-empty.","Trim input client-side and show inline validation before calling the API.","For programmatic callers, assert input.prompt?.trim() is truthy upstream."],"tags":["automations","hermes","validation","input"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}