{"record":{"id":"1450c5d3baeb67c3","repo":"nanocoai/nanoclaw","slug":"task-series-id-is-required","errorCode":null,"errorMessage":"task series id is required","messagePattern":"task series id is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/tasks.ts","lineNumber":137,"sourceCode":"    prompt: content.prompt.length > 120 ? content.prompt.slice(0, 117) + '...' : content.prompt,\n    has_script: content.script ? 1 : 0,\n    origin_session_id: content.originSessionId, // which session created the task (null for CLI-created)\n    created_at: row.timestamp,\n    tries: row.tries,\n  };\n}\n\nfunction selectLiveTasks(mailbox: InboundMailbox, status?: TaskStatus): TaskRow[] {\n  return mailbox.listLiveTasks(status);\n}\n\nfunction selectTask(mailbox: InboundMailbox, id: string): TaskRow | undefined {\n  return mailbox.getTask(id);\n}\n\nfunction taskId(args: Record<string, unknown>): string {\n  const id = str(args.id);\n  if (!id) throw new Error('task series id is required');\n  return id;\n}\n\nasync function createTask(args: Record<string, unknown>, ctx: CallerContext) {\n  const group = groupArg(args, ctx);\n  if (!group) throw new Error('--group is required');\n  const prompt = str(args.prompt);\n  if (!prompt) throw new Error('--prompt is required');\n  const recurrence = normalizeNullableString(args.recurrence) ?? null;\n  const script = normalizeNullableString(args.script) ?? null;\n  const prepared = prepareScheduledTask({\n    name: str(args.name),\n    prompt,\n    recurrence,\n    processAfter: str(args.process_after),\n    script,\n    dangerouslyOverrideRecurrenceLimit: bool(args.dangerously_override_recurrence_limit),\n    timezone: await resolveGroupTimezone(group),","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/tasks.ts#L119-L155","documentation":"Thrown by `taskId` in the tasks resource when an id-taking task verb (`ncl tasks get|update|cancel|pause|resume|delete|append-log|run --id ...`) is invoked without `--id`. Task operations target an existing task series row keyed by id, so the CLI demands it before doing anything else.","triggerScenarios":"Running `ncl tasks cancel` or `ncl tasks get` with no --id; passing the id positionally (`ncl tasks get tsk_123`) instead of via the flag; a typo'd flag name so args.id is never set.","commonSituations":"Assuming positional args work (the ncl grammar is `ncl <resource> <verb> [--id ...]`, not positional); empty $TASK_ID shell variable in automation; id flag named differently in a copied command.","solutions":["Add the flag form: `ncl tasks get --id <task-series-id>`","Find the id first via `ncl tasks list` (or `--json` for scripting)","In scripts, assert the id variable is non-empty before calling ncl"],"exampleFix":"# before\nncl tasks get tsk_abc123\n# after\nncl tasks get --id tsk_abc123","handlingStrategy":"validation","validationCode":"if (!taskId || !taskId.startsWith('task-')) {\n  throw new Error('task series id is required (see ncl tasks list)');\n}\nawait execNcl(['tasks', 'get', '--id', taskId]);","typeGuard":"const isTaskId = (v: unknown): v is string => typeof v === 'string' && v.length > 0;","tryCatchPattern":"catch (e) { if (e.message === 'task series id is required') printUsageAndExit(1); else throw e; }","preventionTips":["Always use the --id flag, never positional args, with ncl verbs","Assert non-empty id variables in shell: : \"${TASK_ID:?--id required}\"","Resolve ids from `ncl tasks list --json` instead of guessing"],"tags":["cli","tasks","validation","missing-id"],"backgroundTag":"missing-required-parameter","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}