multica-ai/multica · error

--issue-prefix cannot be empty; clearing the prefix is not s

Error message

--issue-prefix cannot be empty; clearing the prefix is not supported

What it means

Local CLI validation in `multica workspace update`: passing `--issue-prefix ""` (or whitespace only) is rejected because the server handler silently skips an empty prefix, which would return 200 without changing anything. The CLI fails fast so the no-op is visible instead of silently succeeding.

Source

Thrown at server/cmd/multica/cmd_workspace.go:565

		if err != nil {
			return nil, err
		}
		body["description"] = desc
	}
	if cmd.Flags().Changed("context") || cmd.Flags().Changed("context-stdin") {
		ctxText, _, err := resolveTextFlag(cmd, "context")
		if err != nil {
			return nil, err
		}
		body["context"] = ctxText
	}
	if cmd.Flags().Changed("issue-prefix") {
		v, _ := cmd.Flags().GetString("issue-prefix")
		// The handler silently skips an empty prefix (workspace.go:274), so
		// `--issue-prefix ""` would otherwise return 200 without changing
		// anything. Reject it here so the failure is visible.
		if strings.TrimSpace(v) == "" {
			return nil, fmt.Errorf("--issue-prefix cannot be empty; clearing the prefix is not supported")
		}
		body["issue_prefix"] = v
	}
	return body, nil
}

func runWorkspaceUpdate(cmd *cobra.Command, args []string) error {
	wsID, err := resolveWorkspaceArg(cmd, args)
	if err != nil {
		return err
	}
	if wsID == "" {
		return fmt.Errorf("workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID")
	}

	body, err := buildWorkspaceUpdateBody(cmd)
	if err != nil {
		return err

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Pass a non-empty prefix value, e.g. `multica workspace update <ws> --issue-prefix MULT`
  2. If you meant to change other fields, omit --issue-prefix entirely
  3. If clearing is genuinely required, request it as a feature — the server-side handler (workspace.go:274) skips empty prefixes by design, so there is no API path today
  4. Guard scripts: only include the flag when the variable is non-empty

Example fix

# before
multica workspace update acme --issue-prefix ""

# after (conditionally set the flag)
if [ -n "$PREFIX" ]; then
  multica workspace update acme --issue-prefix "$PREFIX"
fi
Defensive patterns

Strategy: validation

Validate before calling

prefix := strings.TrimSpace(prefixFlag)
if prefix == "" {
    return errors.New("issue prefix cannot be empty; clearing is not supported")
}

Prevention

When it happens

Trigger: Running `multica workspace update <ws> --issue-prefix ""` or `--issue-prefix " "` — i.e. explicitly attempting to clear the workspace's issue prefix.

Common situations: Scripts or shell loops that pass an unset variable which expands to an empty string (`--issue-prefix "$PREFIX"` with PREFIX empty); users trying to remove a previously set prefix; automation assuming clearing is supported.

Related errors


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