{"record":{"id":"dbdfdcc979a3f1fe","repo":"multica-ai/multica","slug":"tail-must-be-a-non-negative-integer-0-returns-j","errorCode":null,"errorMessage":"--tail must be a non-negative integer (0 returns just the thread root)","messagePattern":"--tail must be a non-negative integer \\(0 returns just the thread root\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1826,"sourceCode":"\t// \"user explicitly passed --recent 0\" (or a negative value). The\n\t// GetInt zero-value collapses both cases, which would otherwise\n\t// cause us to silently drop an invalid value and fall back to the\n\t// default unparameterized list — exactly the drift Elon flagged in\n\t// the PR #2787 second review. --tail follows the same pattern, and\n\t// also keeps \"--tail 0\" (root-only) distinguishable from \"no --tail\".\n\trecentSet := cmd.Flags().Changed(\"recent\")\n\ttailSet := cmd.Flags().Changed(\"tail\")\n\tbefore, _ := cmd.Flags().GetString(\"before\")\n\tbeforeID, _ := cmd.Flags().GetString(\"before-id\")\n\n\t// Mirror the server-side combination rules client-side so the user gets\n\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)\")","sourceCodeStart":1808,"sourceCodeEnd":1844,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1808-L1844","documentation":"Error \"--tail must be a non-negative integer (0 returns just the thread root)\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_issue.go:1826 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-negative integer for --tail."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}