multica-ai/multica · error
--max-concurrent-tasks %w (got %d)
Error message
--max-concurrent-tasks %w (got %d)
What it means
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.
Source
Thrown at server/cmd/multica/cmd_agent_validation.go:11
package main
import (
"fmt"
"github.com/multica-ai/multica/server/internal/agentconfig"
)
func validateAgentMaxConcurrentTasksFlag(value int32) error {
if err := agentconfig.ValidateMaxConcurrentTasks(value); err != nil {
return fmt.Errorf(
"--max-concurrent-tasks %w (got %d)",
err,
value,
)
}
return nil
}
View on GitHub (pinned to 2c0912b6ec)
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
Example fix
# before multica agent update <id> --max-concurrent-tasks "$((2 * NPROC))" # can exceed 50 # after MCT=$((2 * NPROC)); [ "$MCT" -gt 50 ] && MCT=50; [ "$MCT" -lt 1 ] && MCT=1 multica agent update <id> --max-concurrent-tasks "$MCT"
Defensive patterns
Strategy: validation
Validate before calling
clamp() { v=$1; [ "$v" -lt 1 ] && v=1; [ "$v" -gt 50 ] && v=50; echo "$v"; }
multica agent update <id> --max-concurrent-tasks "$(clamp "$COMPUTED")" Prevention
- 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
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- --%s, --%s-stdin, and --%s-file are mutually exclusive; pick
- --%s-file: path must not be empty
- --runtime-id must not be empty
- --name must not be empty
- --value is required
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/8d8be1f5d85a27cb.
Report an issue: GitHub.