{"record":{"id":"b3952ec390ef1aca","repo":"multica-ai/multica","slug":"description-stdin-and-context-stdin-cannot-be","errorCode":null,"errorMessage":"--description-stdin and --context-stdin cannot be combined; a single stdin cannot feed both fields — pass one of them inline","messagePattern":"--description-stdin and --context-stdin cannot be combined; a single stdin cannot feed both fields — pass one of them inline","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":302,"sourceCode":"\tif strings.TrimSpace(name) == \"\" {\n\t\treturn nil, fmt.Errorf(\"--name is required\")\n\t}\n\n\t// The server requires both name and slug (POST /api/workspaces returns 400\n\t// without them) and the slug is immutable after creation, so it must be\n\t// chosen explicitly here rather than silently omitted.\n\tslug, _ := cmd.Flags().GetString(\"slug\")\n\tif strings.TrimSpace(slug) == \"\" {\n\t\treturn nil, fmt.Errorf(\"--slug is required\")\n\t}\n\n\t// A single stdin stream cannot feed two fields: whichever field reads first\n\t// drains it and the other gets EOF. Reject the ambiguous combination up\n\t// front instead of surfacing a misleading \"content is empty\" error.\n\tdescStdin, _ := cmd.Flags().GetBool(\"description-stdin\")\n\tctxStdin, _ := cmd.Flags().GetBool(\"context-stdin\")\n\tif descStdin && ctxStdin {\n\t\treturn nil, fmt.Errorf(\"--description-stdin and --context-stdin cannot be combined; a single stdin cannot feed both fields — pass one of them inline\")\n\t}\n\n\tbody := map[string]any{\"name\": name, \"slug\": slug}\n\tif cmd.Flags().Changed(\"description\") || cmd.Flags().Changed(\"description-stdin\") {\n\t\tdesc, _, err := resolveTextFlag(cmd, \"description\")\n\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\") {","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L284-L320","documentation":"`multica workspace create` refuses --description-stdin together with --context-stdin because a process has a single stdin stream: whichever field reads it first drains it and the other would receive EOF and fail with a misleading 'content is empty' error. The combination is rejected up front with the fix spelled out.","triggerScenarios":"Running `cat payload | multica workspace create --name n --slug s --description-stdin --context-stdin`; only the first reader gets the bytes, the second sees EOF.","commonSituations":"Automation that wants to set both long-text fields from piped input in one command.","solutions":["Supply one field via stdin and the other inline: `--description-stdin --context \"text\"` (or vice versa).","Or use --description-file / --context-file for both so stdin is untouched.","Or run two commands: create with one field, then update with the other."],"exampleFix":"# before\ncat desc.txt | multica workspace create --name n --slug s --description-stdin --context-stdin\n\n# after\nmultica workspace create --name n --slug s --description-file desc.txt --context-file ctx.txt","handlingStrategy":"validation","validationCode":"if [ \"$DESC_STDIN\" = true ] && [ \"$CTX_STDIN\" = true ]; then echo 'one stdin cannot feed two fields'; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One stdin consumer per invocation: pair stdin with inline or --file inputs for other fields.","Prefer --description-file/--context-file in automation for deterministic input."],"tags":["cli","validation","stdin","workspace"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}