{"record":{"id":"1882cc826c0a2914","repo":"multica-ai/multica","slug":"kind-must-be-schedule-or-webhook","errorCode":null,"errorMessage":"--kind must be schedule or webhook","messagePattern":"--kind must be schedule or webhook","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_autopilot.go","lineNumber":549,"sourceCode":"\t\t\tstrVal(r, \"completed_at\"),\n\t\t})\n\t}\n\tcli.PrintTable(os.Stdout, headers, rows)\n\treturn nil\n}\n\nfunc runAutopilotTriggerAdd(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkind, _ := cmd.Flags().GetString(\"kind\")\n\tif kind == \"\" {\n\t\tkind = \"schedule\"\n\t}\n\tif kind != \"schedule\" && kind != \"webhook\" {\n\t\treturn fmt.Errorf(\"--kind must be schedule or webhook\")\n\t}\n\tcron, _ := cmd.Flags().GetString(\"cron\")\n\tif kind == \"schedule\" && cron == \"\" {\n\t\treturn fmt.Errorf(\"--cron is required for --kind schedule\")\n\t}\n\tif kind == \"webhook\" {\n\t\tif v, _ := cmd.Flags().GetString(\"timezone\"); v != \"\" {\n\t\t\treturn fmt.Errorf(\"--timezone is only valid with --kind schedule\")\n\t\t}\n\t\tif cron != \"\" {\n\t\t\treturn fmt.Errorf(\"--cron is only valid with --kind schedule\")\n\t\t}\n\t}\n\n\tbody := map[string]any{\"kind\": kind}\n\tif kind == \"schedule\" {\n\t\tbody[\"cron_expression\"] = cron\n\t\tif v, _ := cmd.Flags().GetString(\"timezone\"); v != \"\" {","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_autopilot.go#L531-L567","documentation":"Flag validation in `multica autopilot trigger add` rejecting an unsupported --kind value. Only 'schedule' (the default when --kind is empty) and 'webhook' are accepted; anything else fails fast before any network call is made. This mirrors the server-side trigger kinds the /api/autopilots/{id}/triggers endpoint understands.","triggerScenarios":"Running `autopilot trigger add <ref> --kind cron`, `--kind manual`, `--kind event`, or any typo like `--kind schdule`. Pure client-side check: no HTTP request is issued.","commonSituations":"Assuming the trigger kind matches a generic cron/event vocabulary from other tools; copy-pasting a command written for a newer/older CLI version that had more kinds; shell completion inserting the wrong value.","solutions":["Use --kind schedule (with --cron) or --kind webhook","Omit --kind entirely if you want the schedule default","Check `multica autopilot trigger add --help` for the accepted values in your CLI build"],"exampleFix":"// before\nmultica autopilot trigger add my-pilot --kind cron --cron '0 9 * * *'\n// --kind must be schedule or webhook\n\n// after\nmultica autopilot trigger add my-pilot --kind schedule --cron '0 9 * * *'","handlingStrategy":"validation","validationCode":"KIND=\"${KIND:-schedule}\"\ncase \"$KIND\" in schedule|webhook) ;; *) echo \"--kind must be schedule or webhook\" >&2; exit 2;; esac\nmultica autopilot trigger add \"$ID\" --kind \"$KIND\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate kind in wrapper scripts before invoking the CLI","Omit --kind when the schedule default is intended","Read `--help` after CLI upgrades — accepted kinds may change"],"tags":["go","cli","flag-validation","triggers"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}