Every paged get_all_* wrapper in the admin-cli's ApiClient chunks ids by the CLI's page_size, but the server's *ByIds handlers reject any request whose id count exceeds runtime_config.max_find_by_ids. The two limits are configured independently, so a deployment with page_size > max_find_by_ids makes those list commands fail with InvalidArgument. The pattern is latent across ~18 paged wrappers (machines, instances, racks, switches, power-shelves, network-segments, VPCs, DPAs, partitions, keysets, NSGs, instance-types, remediations, explored managed-hosts/endpoints, mlx devices, …), and ~23 server *ByIds handlers enforce the cap. Surfaced by CodeRabbit on PR #2833.
What this involves
- Add a shared
ApiClient helper -- effective_chunk_size(page_size) -- that reads the server's max_find_by_ids from RuntimeConfig (already on forge.proto field 30, and already fetched via the version RPC; see dpu/versions/cmd.rs) and returns min(page_size, max_find_by_ids).
- Route every paged
get_all_* wrapper through it, replacing the bare .chunks(page_size) with the capped size.
- Guard the unset case: if the server reports
max_find_by_ids == 0 (default/unset), fall back to page_size -- chunks(0) panics.
- Fetch the cap once per command (a single
version call per get_all_*), not per page.
Follow-up to PR #2833 / #2765.
Every paged
get_all_*wrapper in the admin-cli'sApiClientchunks ids by the CLI'spage_size, but the server's*ByIdshandlers reject any request whose id count exceedsruntime_config.max_find_by_ids. The two limits are configured independently, so a deployment withpage_size > max_find_by_idsmakes those list commands fail withInvalidArgument. The pattern is latent across ~18 paged wrappers (machines, instances, racks, switches, power-shelves, network-segments, VPCs, DPAs, partitions, keysets, NSGs, instance-types, remediations, explored managed-hosts/endpoints, mlx devices, …), and ~23 server*ByIdshandlers enforce the cap. Surfaced by CodeRabbit on PR #2833.What this involves
ApiClienthelper --effective_chunk_size(page_size)-- that reads the server'smax_find_by_idsfromRuntimeConfig(already onforge.protofield 30, and already fetched via theversionRPC; seedpu/versions/cmd.rs) and returnsmin(page_size, max_find_by_ids).get_all_*wrapper through it, replacing the bare.chunks(page_size)with the capped size.max_find_by_ids == 0(default/unset), fall back topage_size--chunks(0)panics.versioncall perget_all_*), not per page.Follow-up to PR #2833 / #2765.