{"record":{"id":"34e1b692350aa476","repo":"gastownhall/beads","slug":"offset-is-not-supported-with-hierarchical-pare","errorCode":null,"errorMessage":"--offset is not supported with hierarchical --parent + pretty/tree","messagePattern":"--offset is not supported with hierarchical --parent \\+ pretty/tree","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list_proxied_server.go","lineNumber":63,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open unit of work: %w\", err)\n\t}\n\treturn uw, nil\n}\n\n// runListProxiedTree serves the ONE mode that is deliberately off the role: the\n// hierarchical --parent walk under pretty output. It consumes the FILTER as a\n// value, re-parenting a copy of it at every level, and it reaches no page\n// epilogue on either route.\nfunc runListProxiedTree(ctx context.Context, in listInput) error {\n\tuw, filter, err := openAndPrepare(ctx, in)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer uw.Close(ctx)\n\n\tif in.Offset > 0 {\n\t\treturn fmt.Errorf(\"--offset is not supported with hierarchical --parent + pretty/tree\")\n\t}\n\treturn runListProxiedHierarchicalParent(ctx, uw, in, filter)\n}\n\n// runListProxiedPage is the proxied twin of the direct route's two flips, and\n// it is the same two in the same order: --json first, then every text\n// rendering, both over issueops.Reader.\n//\n// It opens no unit of work of its own — the role opens one per call, which is\n// one more than this route used to for a listing that also loads dependency\n// records. Nothing here was atomic across those reads before either: the\n// renderings ran after the query returned.\nfunc runListProxiedPage(ctx context.Context, out io.Writer, in listInput) error {\n\trd, err := proxiedIssueReader()\n\tif err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list_proxied_server.go#L45-L81","documentation":"In proxied mode, the hierarchical --parent walk with pretty/tree output does not implement pagination offsets. If --offset > 0 is passed alongside --parent with pretty output, this guard rejects the combination explicitly rather than silently ignoring the offset.","triggerScenarios":"`bd list --parent <id> --offset 10` in proxied-server mode with pretty (non-JSON) output. Offset 0 (the default) is allowed.","commonSituations":"Scripted pagination loops that always pass --offset, combining pagination flags with the tree view, or reusing a generic list invocation template across modes.","solutions":["Drop --offset when using --parent with pretty/tree output","Use --limit to cap the tree size instead of paginating","Switch to --json output if you need offset pagination with --parent","Fetch the full tree once and paginate client-side"],"exampleFix":"// before\nbd list --parent bd-1 --offset 10\n// after\nbd list --parent bd-1 --limit 100   # or add --json to keep --offset","handlingStrategy":"validation","validationCode":"# Refuse --offset with hierarchical parent + pretty output before running\nif [[ \"$cmd\" == *\"--parent\"* && \"$cmd\" == *\"--offset\"* && \"$cmd\" != *\"--json\"* ]]; then\n  echo \"--offset unsupported with --parent pretty output\"; exit 2\nfi\nbd list $cmd","typeGuard":null,"tryCatchPattern":"// Detect the combination error and fall back to --json or no offset\nout=$(bd list --parent \"$id\" --offset \"$o\" 2>&1) || case \"$out\" in\n  *\"--offset is not supported\"*) bd list --parent \"$id\";; *) echo \"$out\";; esac","preventionTips":["Never paginate tree views with --offset; use --limit","Add --json when you need offset pagination with --parent","Keep pagination scripts mode-aware (pretty vs json)"],"tags":["cli","pagination","proxied-server"],"backgroundTag":"unsupported-flag-combination","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}