{"record":{"id":"096009330d109644","repo":"multica-ai/multica","slug":"before-before-id-require-recent-thread-cu","errorCode":null,"errorMessage":"--before / --before-id require --recent (thread cursor) or --thread + --tail (reply cursor)","messagePattern":"--before / --before-id require --recent \\(thread cursor\\) or --thread \\+ --tail \\(reply cursor\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":1850,"sourceCode":"\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.\n\t// --full opts out. The partial-thread reads (--since / --tail) and\n\t// --roots-only cannot be folded safely (server rejects fold there), so we\n\t// never send fold for them and --full is a harmless no-op. Sending fold only","sourceCodeStart":1832,"sourceCodeEnd":1868,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L1832-L1868","documentation":"A before-cursor is only meaningful in one of two paging modes: the --recent mode (thread cursor over recently-active threads) or --thread + --tail mode (reply cursor inside one thread). Passing --before/--before-id in any other mode is rejected because the server would have no stable ordering to resume.","triggerScenarios":"Passing --before/--before-id without --recent and without the combination of --thread and --tail (e.g. plain listing, or --thread without --tail).","commonSituations":"Replaying a cursor captured in one mode against a differently-scoped invocation; upgrading scripts after the cursor scheme changed from a single value to a mode-aware composite.","solutions":["Add --recent to page through recent threads with a thread cursor.","Or add both --thread <id> and --tail N to page through one thread's replies.","Otherwise remove the --before/--before-id pair entirely."],"exampleFix":"# before\nmultica issue comment list ISS-1 --before 2026-01-01T00:00:00Z --before-id 42\n# after\nmultica issue comment list ISS-1 --recent --before 2026-01-01T00:00:00Z --before-id 42","handlingStrategy":"validation","validationCode":"# bash: cursor is only valid in --recent or --thread+--tail mode\nif [[ -n \"$BEFORE\" ]]; then\n  if [[ \"$RECENT\" != \"true\" && ( -z \"$THREAD\" || -z \"$TAIL\" ) ]]; then\n    echo \"refusing: --before needs --recent or --thread+--tail\" >&2\n    exit 2\n  fi\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Name cursors by mode in scripts (THREAD_CURSOR vs REPLY_CURSOR) so they cannot be cross-applied.","Capture the paging mode together with the cursor when you first print/store it."],"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"}