{"record":{"id":"64476e5ca2e213a0","repo":"nexu-io/open-design","slug":"schedule-weekly-time-must-be-hh-mm-24h","errorCode":null,"errorMessage":"--schedule weekly time must be HH:MM (24h)","messagePattern":"--schedule weekly time must be HH:MM \\(24h\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/cli.ts","lineNumber":10533,"sourceCode":"    const timezone = parts.slice(3).join(':') || 'UTC';\n    return { kind, time, timezone };\n  }\n  if (kind === 'weekly') {\n    if (parts.length < 4) {\n      throw new Error('--schedule weekly requires :DAY:HH:MM[:TZ] (DAY is 0-6 or sun/mon/...)');\n    }\n    const dayToken = String(parts[1]).toLowerCase();\n    let weekday;\n    if (/^[0-6]$/.test(dayToken)) {\n      weekday = Number(dayToken);\n    } else if (AUTOMATION_WEEKDAY_TOKENS[dayToken] !== undefined) {\n      weekday = AUTOMATION_WEEKDAY_TOKENS[dayToken];\n    } else {\n      throw new Error(`--schedule weekly day must be 0-6 or sun..sat (got \"${parts[1]}\")`);\n    }\n    const time = `${parts[2].padStart(2, '0')}:${parts[3].padStart(2, '0')}`;\n    if (!/^[0-2]\\d:[0-5]\\d$/.test(time)) {\n      throw new Error('--schedule weekly time must be HH:MM (24h)');\n    }\n    const timezone = parts.slice(4).join(':') || 'UTC';\n    return { kind: 'weekly', weekday, time, timezone };\n  }\n  throw new Error(`--schedule kind must be hourly|daily|weekdays|weekly (got \"${kind}\")`);\n}\n\nfunction parseAutomationTarget(flags) {\n  const raw = flags.target;\n  if (raw == null) {\n    if (flags.project) return { mode: 'reuse', projectId: String(flags.project) };\n    return { mode: 'create_each_run' };\n  }\n  const value = String(raw);\n  if (\n    value === 'worktree' ||\n    value === 'new-project' ||\n    value === 'create-each-run' ||","sourceCodeStart":10515,"sourceCodeEnd":10551,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/cli.ts#L10515-L10551","documentation":"Thrown by parseScheduleFlag for a weekly schedule when the HH:MM portion (parts[2]:parts[3]) fails the same 24h regex `/^[0-2]\\d:[0-5]\\d$/` as the daily/weekdays check. The day token has already been validated by the time this runs, so the day is fine and only the time is wrong.","triggerScenarios":"Running `--schedule weekly:mon:25:30` (hour >23 shape), `--schedule weekly:mon:09:60` (minute >59), `--schedule weekly:mon:09:abc`, or `--schedule weekly:1:2:30pm`.","commonSituations":"Reusing a 12-hour time with AM/PM, misaligning the colon segments so the time lands in the wrong slots, or using `24:00` for midnight.","solutions":["Use a 24h HH:MM value in the time slots, e.g. `--schedule weekly:mon:14:30`.","Recount the colons: weekly is kind:DAY:HH:MM[:TZ] — make sure HH and MM are the 3rd and 4th segments.","Drop AM/PM suffixes and any seconds component."],"exampleFix":"// before\n--schedule weekly:mon:2:30pm\n// after\n--schedule weekly:mon:14:30","handlingStrategy":"validation","validationCode":"// For weekly: parts = kind:DAY:HH:MM[:TZ]; validate HH:MM = parts[2]:parts[3].\nfunction weeklyTimeIsValid(raw: string): boolean {\n  const parts = raw.split(':');\n  if (parts.length < 4) return false;\n  const time = `${parts[2].padStart(2,'0')}:${parts[3].padStart(2,'0')}`;\n  return /^[0-2]\\d:[0-5]\\d$/.test(time);\n}","typeGuard":null,"tryCatchPattern":"try {\n  parseScheduleFlag(raw);\n} catch (err) {\n  if (err instanceof Error && /weekly time must be HH:MM/.test(err.message)) {\n    // fix the time slots (3rd and 4th colon segments)\n  }\n  throw err;\n}","preventionTips":["Count colons: weekly time lives in the 3rd and 4th segments, not the 2nd and 3rd.","Reuse the same 24h HH:MM discipline as the daily form."],"tags":["cli","validation","automation","schedule","flag-parsing"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}