{"record":{"id":"7b469cbabd461f90","repo":"multica-ai/multica","slug":"before-and-before-id-must-be-set-together-com","errorCode":null,"errorMessage":"--before and --before-id must be set together (composite cursor for stable pagination)","messagePattern":"--before and --before-id must be set together \\(composite cursor for stable pagination\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1847,"sourceCode":"\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}\n\t// Resolve-aware folding is the default on the complete-thread reads (default\n\t// list, --recent, --thread without --tail): a resolved thread collapses to\n\t// root + conclusion so an agent does not pay tokens for settled discussion.","sourceCodeStart":1829,"sourceCodeEnd":1865,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1829-L1865","documentation":"The comment-list pagination cursor is composite: --before is a timestamp and --before-id is a tie-breaking comment ID. The CLI requires both to be set together so the server can order stably; passing only one is rejected before the request is sent.","triggerScenarios":"Passing --before without --before-id, or --before-id without --before. The check is (before == \"\") != (beforeID == \"\").","commonSituations":"Manually typing only the timestamp half of a cursor; scripts that forward the X-Multica-Next-Before header but drop X-Multica-Next-Before-Id.","solutions":["Copy BOTH values from the 'Next thread cursor' / 'Next reply cursor' line the CLI prints on stderr.","If scripting, always read the header pair (X-Multica-Next-Before and X-Multica-Next-Before-Id) together and pass both or neither."],"exampleFix":"# before\nmultica issue comment list ISS-1 --recent --before 2026-01-01T00:00:00Z\n# after\nmultica issue comment list ISS-1 --recent --before 2026-01-01T00:00:00Z --before-id 42","handlingStrategy":"validation","validationCode":"# bash: pass cursors as an atomic pair\nif [[ -n \"$BEFORE\" || -n \"$BEFORE_ID\" ]] && [[ -z \"$BEFORE\" || -z \"$BEFORE_ID\" ]]; then\n  echo \"refusing: --before and --before-id must be set together\" >&2\n  exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always copy the full 'Next ... cursor' stderr line (timestamp + id) verbatim.","When scripting against headers, read X-Multica-Next-Before and X-Multica-Next-Before-Id as a unit and store them in one variable."],"tags":["cli","flag-validation","pagination","cursor"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}