{"record":{"id":"0fe74fbffa99d707","repo":"multica-ai/multica","slug":"id-is-required","errorCode":null,"errorMessage":"id is required","messagePattern":"id is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_id_resolver.go","lineNumber":58,"sourceCode":"\tid := strVal(issue, \"id\")\n\tif id != \"\" {\n\t\tslog.Warn(\"issue response missing identifier\", \"issue_id\", id)\n\t}\n\treturn id\n}\n\nfunc issueCandidate(issue map[string]any) idCandidate {\n\treturn idCandidate{\n\t\tID:      strVal(issue, \"id\"),\n\t\tDisplay: issueDisplayKey(issue),\n\t\tDetail:  strVal(issue, \"title\"),\n\t}\n}\n\nfunc normalizeUUIDPrefix(input string) (string, error) {\n\ttrimmed := strings.TrimSpace(input)\n\tif trimmed == \"\" {\n\t\treturn \"\", fmt.Errorf(\"id is required\")\n\t}\n\tprefix := strings.ToLower(strings.ReplaceAll(trimmed, \"-\", \"\"))\n\tif len(prefix) < minShortIDPrefixLen {\n\t\treturn \"\", fmt.Errorf(\"expected a full UUID or at least %d hex characters, got %q\", minShortIDPrefixLen, input)\n\t}\n\tfor _, r := range prefix {\n\t\tif !((r >= '0' && r <= '9') || (r >= 'a' && r <= 'f')) {\n\t\t\treturn \"\", fmt.Errorf(\"expected a UUID prefix containing only hex characters, got %q\", input)\n\t\t}\n\t}\n\treturn prefix, nil\n}\n\nfunc compactUUID(id string) string {\n\treturn strings.ToLower(strings.ReplaceAll(strings.TrimSpace(id), \"-\", \"\"))\n}\n\nfunc resolveIDByPrefix(ctx context.Context, client *cli.APIClient, kind, input string, fetch func(context.Context, *cli.APIClient) ([]idCandidate, error)) (resolvedID, error) {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_id_resolver.go#L40-L76","documentation":"Returned by normalizeUUIDPrefix when the input, after trimming whitespace, is the empty string. The CLI requires some non-empty id value before it can attempt UUID-prefix normalization; an empty argument is treated as a missing required value rather than a formatting problem.","triggerScenarios":"Calling any resolver that uses normalizeUUIDPrefix (autopilot, project, label, task run, etc.) with an id argument of \"\", \" \", or a value that trims to empty. Typically the result of an unset shell variable or an empty flag value passed through a script.","commonSituations":"Shell scripts passing \"$MY_VAR\" when MY_VAR is unset; CI pipelines forwarding an empty parameter; copy-paste commands where the id placeholder was never replaced.","solutions":["Supply a non-empty id: a full UUID or a UUID prefix of at least 4 hex characters","If the id comes from a variable, check that it is set before invoking the CLI (e.g. \"${VAR:?id is required}\")","If the id was supposed to come from a previous command's output, verify that command succeeded and produced output"],"exampleFix":"# before\nISSUE_ID=\"\"\nmultica issue show \"$ISSUE_ID\"\n\n# after\nISSUE_ID=\"$(multica issue list --full-id | head -1 | awk '{print $1}')\"\nmultica issue show \"$ISSUE_ID\"","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# fail fast on empty ids before invoking the CLI\n: \"${ISSUE_ID:?id is required}\"\nmultica issue show \"$ISSUE_ID\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use ${VAR:?message} expansion in scripts to abort on empty variables","Never forward optional flags unconditionally; gate them on non-empty values"],"tags":["cli","validation","id-resolution","empty-input"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}