{"record":{"id":"144b05262e730374","repo":"multica-ai/multica","slug":"tail-requires-thread-it-is-a-thread-scoped-li","errorCode":null,"errorMessage":"--tail requires --thread (it is a thread-scoped limit)","messagePattern":"--tail requires --thread \\(it is a thread-scoped limit\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1844,"sourceCode":"\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}\n\tif summary {\n\t\tparams.Set(\"summary\", \"true\")\n\t}","sourceCodeStart":1826,"sourceCodeEnd":1862,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1826-L1862","documentation":"The --tail flag limits how many replies are returned inside a single thread, so it is only valid when a thread is selected via --thread. Using --tail without --thread is rejected up front by the comment-list flag validation.","triggerScenarios":"Running `multica issue comment list <issue> --tail 20` without also passing --thread <comment-id>. The check is tailSet && thread == \"\".","commonSituations":"Assuming --tail is a global 'last N comments' limit; adapting a --recent command to --tail without adding the thread scope.","solutions":["Add --thread <comment-id> to scope the tail to that thread.","If you wanted the newest comments overall, use --recent N instead of --tail N."],"exampleFix":"# before\nmultica issue comment list ISS-1 --tail 20\n# after\nmultica issue comment list ISS-1 --thread cmt_abc123 --tail 20","handlingStrategy":"validation","validationCode":"# bash: enforce thread scope before calling the CLI\nif [[ -n \"$TAIL\" && -z \"$THREAD\" ]]; then\n  echo \"refusing: --tail requires --thread\" >&2\n  exit 2\nfi\nmultica issue comment list \"$ISSUE\" ${THREAD:+--thread \"$THREAD\"} ${TAIL:+--tail \"$TAIL\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Model the three paging modes as distinct script functions so --tail is never typed outside thread mode.","Read the command's --help output after CLI upgrades; flag semantics change."],"tags":["cli","flag-validation","threads"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}