{"record":{"id":"747d1c7989f86dba","repo":"multica-ai/multica","slug":"roots-only-and-tail-are-mutually-exclusive","errorCode":null,"errorMessage":"--roots-only and --tail are mutually exclusive","messagePattern":"--roots-only and --tail are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1838,"sourceCode":"\t// a clear local error instead of a 400 round-trip. These match the\n\t// validation in handler.ListComments (server/internal/handler/comment.go).\n\tif recentSet && recent <= 0 {\n\t\treturn fmt.Errorf(\"--recent must be a positive integer\")\n\t}\n\tif tailSet && tail < 0 {\n\t\treturn fmt.Errorf(\"--tail must be a non-negative integer (0 returns just the thread root)\")\n\t}\n\tif thread != \"\" && recentSet {\n\t\treturn fmt.Errorf(\"--thread and --recent are mutually exclusive\")\n\t}\n\tif rootsOnly && thread != \"\" {\n\t\treturn fmt.Errorf(\"--roots-only and --thread are mutually exclusive\")\n\t}\n\tif rootsOnly && recentSet {\n\t\treturn fmt.Errorf(\"--roots-only and --recent are mutually exclusive\")\n\t}\n\tif rootsOnly && tailSet {\n\t\treturn fmt.Errorf(\"--roots-only and --tail are mutually exclusive\")\n\t}\n\tif rootsOnly && before != \"\" {\n\t\treturn fmt.Errorf(\"--roots-only does not support --before / --before-id\")\n\t}\n\tif tailSet && thread == \"\" {\n\t\treturn fmt.Errorf(\"--tail requires --thread (it is a thread-scoped limit)\")\n\t}\n\tif (before == \"\") != (beforeID == \"\") {\n\t\treturn fmt.Errorf(\"--before and --before-id must be set together (composite cursor for stable pagination)\")\n\t}\n\tif before != \"\" && !recentSet && !(thread != \"\" && tailSet) {\n\t\treturn fmt.Errorf(\"--before / --before-id require --recent (thread cursor) or --thread + --tail (reply cursor)\")\n\t}\n\n\tparams := url.Values{}\n\tif since != \"\" {\n\t\tparams.Set(\"since\", since)\n\t}","sourceCodeStart":1820,"sourceCodeEnd":1856,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1820-L1856","documentation":"Mutually-exclusive flag guard in the issue comment listing command: --roots-only asks for only top-level comments while --tail asks for the last N of a thread, so specifying both would produce contradictory output. This mirrors the server-side validation in handler.ListComments to fail fast with a local error instead of a 400 round-trip.","triggerScenarios":"Thrown at server/cmd/multica/cmd_issue.go:1838 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use either --roots-only or --tail, not both."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}