{"record":{"id":"ba063e35d9e2a4ae","repo":"multica-ai/multica","slug":"roots-only-does-not-support-before-before","errorCode":null,"errorMessage":"--roots-only does not support --before / --before-id","messagePattern":"--roots-only does not support --before / --before-id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1841,"sourceCode":"\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}\n\tif rootsOnly {\n\t\tparams.Set(\"roots_only\", \"true\")\n\t}","sourceCodeStart":1823,"sourceCodeEnd":1859,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1823-L1859","documentation":"multica's issue comment list command rejects the combination of --roots-only with --before/--before-id. --roots-only fetches only top-level issue comments, a mode that has no cursor pagination, so a before-cursor is meaningless there. The check fires before any HTTP request is made.","triggerScenarios":"Running `multica issue comment list <issue> --roots-only --before <ts>` (or with --before-id). Any invocation where rootsOnly is true and the before string is non-empty fails immediately.","commonSituations":"Copy-pasting a 'next thread cursor' printed by a previous --recent run into a --roots-only invocation; scripts that mechanically forward every pagination cursor regardless of the listing mode.","solutions":["Drop --before/--before-id from the command when using --roots-only.","If you intended cursor pagination, remove --roots-only and use --recent with the printed cursor pair.","If you intended only top-level comments, page with --since instead of a before-cursor."],"exampleFix":"# before\nmultica issue comment list ISS-1 --roots-only --before 2026-01-01T00:00:00Z --before-id 42\n# after\nmultica issue comment list ISS-1 --roots-only","handlingStrategy":"validation","validationCode":"# bash: reject the bad combo before invoking the CLI\nif [[ -n \"$BEFORE\" && \"$ROOTS_ONLY\" == \"true\" ]]; then\n  echo \"refusing: --roots-only has no cursor pagination\" >&2\n  exit 2\nfi\nmultica issue comment list \"$ISSUE\" ${ROOTS_ONLY:+--roots-only} ${BEFORE:+--before \"$BEFORE\" --before-id \"$BEFORE_ID\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat every 'Next cursor' line as mode-bound: never forward a cursor into a differently-scoped invocation.","Wrap the CLI in a script that encodes the valid flag matrices (roots-only / recent / thread+tail) as separate functions."],"tags":["cli","flag-validation","pagination"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}