multica-ai/multica · error

resolve label: %w

Error message

resolve label: %w

What it means

Wraps a resolveLabelID failure while `multica label get` resolves its positional argument. Label resolution fetches all labels for the client's workspace (requires workspace_id) and matches by ID prefix or name; failure means either the candidate fetch failed or no label matched.

Source

Thrown at server/cmd/multica/cmd_label.go:139

			strVal(l, "color"),
			created,
		})
	}
	cli.PrintTable(os.Stdout, headers, rows)
	return nil
}

func runLabelGet(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}
	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	labelRef, err := resolveLabelID(ctx, client, args[0])
	if err != nil {
		return fmt.Errorf("resolve label: %w", err)
	}

	var label map[string]any
	if err := client.GetJSON(ctx, "/api/labels/"+labelRef.ID, &label); err != nil {
		return fmt.Errorf("get label: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "table" {
		headers := []string{"ID", "NAME", "COLOR", "CREATED"}
		created := strVal(label, "created_at")
		if len(created) >= 10 {
			created = created[:10]
		}
		rows := [][]string{{
			strVal(label, "id"),
			strVal(label, "name"),
			strVal(label, "color"),

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Run `multica label list` to see the exact names/IDs available in the current workspace
  2. Ensure a workspace is selected/configured for the CLI profile
  3. Use the full label UUID to avoid prefix ambiguity
  4. Fix auth/network if the listing itself errors
Defensive patterns

Strategy: validation

Validate before calling

# bash: confirm the label exists before getting it
multica label list --output json | jq -e --arg n "$LABEL" '.[] | select(.name == $n)' >/dev/null \
  || { echo "no label named $LABEL" >&2; exit 2; }

Prevention

When it happens

Trigger: Passing a label name or ID prefix with no match in the workspace; no workspace configured on the client (resolver errors with 'workspace_id is required to resolve label id prefixes'); the candidate-list GET /api/labels failing on auth/network.

Common situations: Label renamed or deleted; wrong workspace selected; typo in the label name; running in a daemon/task context without a workspace context.

Related errors


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