multica-ai/multica · error

max_concurrent_tasks must be an integer: %w

Error message

max_concurrent_tasks must be an integer: %w

What it means

applyConfigSet parses the max_concurrent_tasks value with strconv.Atoi and rejects anything that is not a plain base-10 integer. Empty string is handled earlier as 'clear the field', so this error means a non-empty, non-integer value was supplied.

Source

Thrown at server/cmd/multica/cmd_config.go:183

	case "workspaces_root":
		value = strings.TrimSpace(value)
		if value == "" {
			cfg.WorkspacesRoot = ""
			return nil
		}
		root, err := filepath.Abs(value)
		if err != nil {
			return fmt.Errorf("resolve workspaces_root: %w", err)
		}
		cfg.WorkspacesRoot = root
	case "max_concurrent_tasks":
		if value == "" {
			cfg.MaxConcurrentTasks = 0
			return nil
		}
		n, err := strconv.Atoi(value)
		if err != nil {
			return fmt.Errorf("max_concurrent_tasks must be an integer: %w", err)
		}
		if n < 0 {
			return fmt.Errorf("max_concurrent_tasks must be >= 0 (got %d)", n)
		}
		cfg.MaxConcurrentTasks = n
	case "poll_interval":
		if value == "" {
			cfg.PollInterval = ""
			return nil
		}
		d, err := time.ParseDuration(value)
		if err != nil {
			return fmt.Errorf("poll_interval must be a Go duration (e.g. 10s, 500ms): %w", err)
		}
		// Reject zero and negative durations. Persisting "0s" would look
		// configured in `config show` but be silently ignored at daemon
		// start (the resolver only substitutes strictly positive values),
		// which is exactly the trap reported in #3824's review. Empty

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Use a plain integer: `multica config set max_concurrent_tasks 4`.
  2. Strip whitespace/separators when generating the value in scripts (e.g. printf '%d' in shell).
  3. To unset, pass an empty string: `multica config set max_concurrent_tasks ""`.

Example fix

# before
multica config set max_concurrent_tasks 2.5
# after
multica config set max_concurrent_tasks 3
Defensive patterns

Strategy: validation

Validate before calling

# shell: validate integer shape before config set
[[ "$VAL" =~ ^-?[0-9]+$ ]] || { echo "max_concurrent_tasks must be an integer" >&2; exit 2; }
multica config set max_concurrent_tasks "$VAL"

Prevention

When it happens

Trigger: `multica config set max_concurrent_tasks 4.0`, `... 2,5` (locale thousands separator), `... "5 "` with stray characters, or `0x10`.

Common situations: Floating-point values like 2.5 copied from docs or plans; locale-formatted numbers pasted from spreadsheets; trailing whitespace/newlines from echo in scripts.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/5e03f2d673ee7d87. Report an issue: GitHub.