{"record":{"id":"aef98a0c92f870c1","repo":"multica-ai/multica","slug":"issue-prefix-cannot-be-empty-clearing-the-prefi","errorCode":null,"errorMessage":"--issue-prefix cannot be empty; clearing the prefix is not supported","messagePattern":"--issue-prefix cannot be empty; clearing the prefix is not supported","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":565,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbody[\"description\"] = desc\n\t}\n\tif cmd.Flags().Changed(\"context\") || cmd.Flags().Changed(\"context-stdin\") {\n\t\tctxText, _, err := resolveTextFlag(cmd, \"context\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbody[\"context\"] = ctxText\n\t}\n\tif cmd.Flags().Changed(\"issue-prefix\") {\n\t\tv, _ := cmd.Flags().GetString(\"issue-prefix\")\n\t\t// The handler silently skips an empty prefix (workspace.go:274), so\n\t\t// `--issue-prefix \"\"` would otherwise return 200 without changing\n\t\t// anything. Reject it here so the failure is visible.\n\t\tif strings.TrimSpace(v) == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"--issue-prefix cannot be empty; clearing the prefix is not supported\")\n\t\t}\n\t\tbody[\"issue_prefix\"] = v\n\t}\n\treturn body, nil\n}\n\nfunc runWorkspaceUpdate(cmd *cobra.Command, args []string) error {\n\twsID, err := resolveWorkspaceArg(cmd, args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif wsID == \"\" {\n\t\treturn fmt.Errorf(\"workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID\")\n\t}\n\n\tbody, err := buildWorkspaceUpdateBody(cmd)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L547-L583","documentation":"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.","triggerScenarios":"Running `multica workspace update <ws> --issue-prefix \"\"` or `--issue-prefix \"   \"` — i.e. explicitly attempting to clear the workspace's issue prefix.","commonSituations":"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.","solutions":["Pass a non-empty prefix value, e.g. `multica workspace update <ws> --issue-prefix MULT`","If you meant to change other fields, omit --issue-prefix entirely","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","Guard scripts: only include the flag when the variable is non-empty"],"exampleFix":"# before\nmultica workspace update acme --issue-prefix \"\"\n\n# after (conditionally set the flag)\nif [ -n \"$PREFIX\" ]; then\n  multica workspace update acme --issue-prefix \"$PREFIX\"\nfi","handlingStrategy":"validation","validationCode":"prefix := strings.TrimSpace(prefixFlag)\nif prefix == \"\" {\n    return errors.New(\"issue prefix cannot be empty; clearing is not supported\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass --issue-prefix from an unguarded variable; test it is non-empty first","Treat issue-prefix as set-once/change-only — clearing requires server-side support that does not exist","In shell scripts use `${PREFIX:?}` to fail on empty values"],"tags":["cli","validation","workspace","issue-prefix"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}