{"record":{"id":"bf968f331d1bf5ae","repo":"alibaba/open-code-review","slug":"effort-w","errorCode":null,"errorMessage":"--effort: %w","messagePattern":"--effort: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/opencodereview/shared_flags.go","lineNumber":158,"sourceCode":"\tif opts.maxTools < 0 {\n\t\treturn fmt.Errorf(\"--max-tools must be a non-negative integer (0 means use template default)\")\n\t}\n\tif opts.maxTools > 0 && opts.maxTools < minMaxTools {\n\t\tfmt.Fprintf(os.Stderr, \"[ocr] --max-tools %d is below minimum %d, using %d\\n\", opts.maxTools, minMaxTools, minMaxTools)\n\t\topts.maxTools = minMaxTools\n\t}\n\tif opts.maxGitProcs < 0 {\n\t\treturn fmt.Errorf(\"--max-git-procs must be a non-negative integer (0 means use default 16)\")\n\t}\n\tif opts.maxTokens < 0 {\n\t\treturn fmt.Errorf(\"--max-tokens must be a non-negative integer (0 means use configured or template default)\")\n\t}\n\tif opts.maxTokensBudget < 0 {\n\t\treturn fmt.Errorf(\"--max-tokens-budget must be a non-negative integer (0 means unlimited)\")\n\t}\n\tif opts.effort != \"\" {\n\t\tif _, err := template.ParseEffort(opts.effort); err != nil {\n\t\t\treturn fmt.Errorf(\"--effort: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateScanOptions(opts *scanOptions) error {\n\tif err := validateAudience(opts.audience); err != nil {\n\t\treturn err\n\t}\n\tnormalizedFormat, err := validateOutputFormat(opts.outputFormat)\n\tif err != nil {\n\t\treturn err\n\t}\n\topts.outputFormat = normalizedFormat\n\tif opts.maxTools < 0 {\n\t\treturn fmt.Errorf(\"--max-tools must be a non-negative integer (0 means use template default)\")\n\t}\n\tif opts.maxGitProcs < 0 {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/alibaba/open-code-review/blob/5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f/cmd/opencodereview/shared_flags.go#L140-L176","documentation":"validateReviewOptions in cmd/opencodereview/shared_flags.go wraps any error returned by template.ParseEffort with the --effort prefix. ParseEffort rejects effort levels that are not one of the recognized keywords, so this error means the --effort flag value could not be parsed into a valid effort setting.","triggerScenarios":"Running `ocr review --effort maximum` (or any string ParseEffort does not recognize). The check only runs when --effort is non-empty, so omitting the flag never triggers it.","commonSituations":"Typos in effort keywords; copying a flag value from a different tool that uses different effort names; documentation drift after the accepted keyword set changed between versions.","solutions":["Use a valid effort keyword accepted by template.ParseEffort (e.g. low/medium/high as documented by the tool)","Run with no --effort flag to use the template default","Check the tool's help/docs for the current list of accepted effort values"],"exampleFix":"// before\nocr review --effort maximum\n// after\nocr review --effort high","handlingStrategy":"validation","validationCode":"case \"$EFFORT\" in \"\"|low|medium|high) ;; *) echo \"invalid effort: $EFFORT\" >&2; exit 2;; esac\nocr review --effort \"$EFFORT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass --effort with values listed in the tool's documentation","Quote flag values to avoid shell splitting producing garbage","Pin CLI versions in scripts so accepted keyword sets don't drift"],"tags":["cli","flag-validation","enum"],"backgroundTag":"invalid-cli-flag-value","analyzedSha":"5cf97d0d15cbd41b602513c4be3bfec3cee5bf7f","analyzedAt":"2026-09-02T02:08:09.116Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}