{"record":{"id":"6a18428b7b776a73","repo":"multica-ai/multica","slug":"resource-type-must-be-issue-agent-or-skill","errorCode":null,"errorMessage":"resource_type must be issue, agent, or skill","messagePattern":"resource_type must be issue, agent, or skill","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/internal/handler/label.go","lineNumber":96,"sourceCode":"\ntype UpdateLabelRequest struct {\n\tName        *string `json:\"name\"`\n\tDescription *string `json:\"description\"`\n\tColor       *string `json:\"color\"`\n}\n\nconst defaultLabelResourceType = \"issue\"\n\nfunc parseLabelResourceType(raw string) (string, error) {\n\tvalue := strings.TrimSpace(raw)\n\tif value == \"\" {\n\t\treturn defaultLabelResourceType, nil\n\t}\n\tswitch value {\n\tcase \"issue\", \"agent\", \"skill\":\n\t\treturn value, nil\n\tdefault:\n\t\treturn \"\", errors.New(\"resource_type must be issue, agent, or skill\")\n\t}\n}\n\n// 6-digit hex, with or without leading '#'.\nvar hexColorRE = regexp.MustCompile(`^#?[0-9a-fA-F]{6}$`)\n\n// normalizeColor returns a canonical \"#rrggbb\" form or an error if invalid.\n//\n// LOAD-BEARING INVARIANT: LabelChip renders `style={{ backgroundColor: color }}`\n// directly in the frontend. If this regex is ever relaxed to accept arbitrary\n// CSS (named colors, `url(...)`, etc.), that inline style becomes an injection\n// surface. Keep the regex strict.\nfunc normalizeColor(c string) (string, error) {\n\tc = strings.TrimSpace(c)\n\tif !hexColorRE.MatchString(c) {\n\t\treturn \"\", errors.New(\"color must be a 6-digit hex value like #3b82f6\")\n\t}\n\tif !strings.HasPrefix(c, \"#\") {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/handler/label.go#L78-L114","documentation":"Error \"resource_type must be issue, agent, or skill\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/handler/label.go:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set resource_type to one of the allowed values: issue, agent, or skill."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}