multica-ai/multica · error

--name must not be empty

Error message

--name must not be empty

What it means

Thrown by `multica agent copy` when --name was explicitly changed on the command line but its value is the empty string. The default name is "<source name> (copy)"; the check only fires when the flag is actively set to empty. Client-side validation before the create request.

Source

Thrown at server/cmd/multica/cmd_agent_copy.go:132

	targetRuntimeID := srcRuntimeID
	if cmd.Flags().Changed("runtime-id") {
		v, _ := cmd.Flags().GetString("runtime-id")
		if v == "" {
			return fmt.Errorf("--runtime-id must not be empty")
		}
		targetRuntimeID = v
	}
	if targetRuntimeID == "" {
		return fmt.Errorf("source agent has no runtime; pass --runtime-id to choose a target runtime")
	}
	sameRuntime := targetRuntimeID == srcRuntimeID

	// Name: default "<source name> (copy)", override with --name.
	name := strVal(src, "name") + " (copy)"
	if cmd.Flags().Changed("name") {
		v, _ := cmd.Flags().GetString("name")
		if v == "" {
			return fmt.Errorf("--name must not be empty")
		}
		name = v
	}

	body := map[string]any{
		"name":       name,
		"runtime_id": targetRuntimeID,
	}

	// Plain-text fields: copy from source, override with the matching flag.
	body["description"] = strVal(src, "description")
	if cmd.Flags().Changed("description") {
		v, _ := cmd.Flags().GetString("description")
		body["description"] = v
	}
	body["instructions"] = strVal(src, "instructions")
	if cmd.Flags().Changed("instructions") {
		v, _ := cmd.Flags().GetString("instructions")

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Provide a non-empty name: multica agent copy <id> --name "my-agent-prod"
  2. Or drop --name to accept the default "<source> (copy)"
  3. In scripts, add the flag only when the variable is non-empty

Example fix

# before
multica agent copy <id> --name "$NEW_NAME"   # NEW_NAME=""
# after
multica agent copy <id> --name "billing-agent-copy"
Defensive patterns

Strategy: validation

Validate before calling

[ -n "${NEW_NAME:-}" ] && multica agent copy "$AGENT_ID" --name "$NEW_NAME" || multica agent copy "$AGENT_ID"

Prevention

When it happens

Trigger: `multica agent copy <id> --name ""` or `--name "$NAME"` with NAME unset/empty in the shell.

Common situations: Wrapper scripts with optional naming where the variable is missing; CI pipelines templating the name from an empty build parameter.

Related errors


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