{"record":{"id":"8d8be1f5d85a27cb","repo":"multica-ai/multica","slug":"max-concurrent-tasks-w-got-d","errorCode":null,"errorMessage":"--max-concurrent-tasks %w (got %d)","messagePattern":"--max-concurrent-tasks %w \\(got (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent_validation.go","lineNumber":11,"sourceCode":"package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/multica-ai/multica/server/internal/agentconfig\"\n)\n\nfunc validateAgentMaxConcurrentTasksFlag(value int32) error {\n\tif err := agentconfig.ValidateMaxConcurrentTasks(value); err != nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"--max-concurrent-tasks %w (got %d)\",\n\t\t\terr,\n\t\t\tvalue,\n\t\t)\n\t}\n\treturn nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":19,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent_validation.go#L1-L19","documentation":"Thrown by validateAgentMaxConcurrentTasksFlag when the --max-concurrent-tasks value falls outside the allowed range [1, 50] enforced by agentconfig.ValidateMaxConcurrentTasks (MinMaxConcurrentTasks=1, MaxMaxConcurrentTasks=50; default is 6). The message wraps the range error and appends the offending value. Validation is client-side, so the API is never called with a bad value.","triggerScenarios":"`multica agent update <id> --max-concurrent-tasks 0`, `--max-concurrent-tasks -1`, or `--max-concurrent-tasks 100` on agent create/update/copy commands that expose the flag.","commonSituations":"Scripts computing the value from a formula or env var that yields 0 (e.g. unset CPU count math); copying configs tuned for a larger deployment; assuming 0 or -1 means 'unlimited', which this CLI does not support.","solutions":["Choose a value in [1, 50], e.g. the default 6","Clamp computed values in scripts before passing the flag","If you need unbounded concurrency, note it is unsupported — file a feature request instead of working around validation"],"exampleFix":"# before\nmultica agent update <id> --max-concurrent-tasks \"$((2 * NPROC))\"   # can exceed 50\n# after\nMCT=$((2 * NPROC)); [ \"$MCT\" -gt 50 ] && MCT=50; [ \"$MCT\" -lt 1 ] && MCT=1\nmultica agent update <id> --max-concurrent-tasks \"$MCT\"","handlingStrategy":"validation","validationCode":"clamp() { v=$1; [ \"$v\" -lt 1 ] && v=1; [ \"$v\" -gt 50 ] && v=50; echo \"$v\"; }\nmultica agent update <id> --max-concurrent-tasks \"$(clamp \"$COMPUTED\")\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the valid range is 1..50 (default 6); 0 and -1 are not 'unlimited'","Clamp formula-derived values before passing the flag","Validate agent config files in CI against the same bounds"],"tags":["cli","validation","flags","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}