Skip to content

fix(workspace): page through listMyWorkSpaces so workspace list returns all workspaces (prepare 2.10.3) - #325

Merged
XXPermanentXX merged 2 commits into
mainfrom
fix/workspace-list-pagination
Nov 18, 2026
Merged

XXPermanentXX merged 2 commits into
mainfrom
fix/workspace-list-pagination

Conversation

@lishengzxc

Copy link
Copy Markdown
Contributor

Summary

bl workspace list only returned the first 10 workspaces for accounts with more (reported in the enterprise CLI feedback group: 20 workspaces exist, only 10 listed). The same single-page read backs console workspace identity resolution (resolveConsoleWorkspaceAgent), so workspaces beyond the first page could not be resolved for telemetry / alert / log / dataset / file / deploy commands either.

Root cause verified against the live gateway and the maas-x API registry: the zelda space.listWorkspaces service has no pagination inputs at all (its reqDTO only carries filters). The console frontend pages through the BailianControl POP ListWorkspaces layer, which the CLI gateway does not expose — top-level skip/maxResults and reqDTO.pageNo/pageSize on that API are all silently ignored (live-probed). The sibling API space.listMyWorkSpaces does accept reqDTO.pageNo/pageSize and returns { list, total, pageNo, pageSize } with the same workspace fields (workspaceId / agentName / defaultAgent / tenantId).

Changes

  • listConsoleWorkspaces now calls space.listMyWorkSpaces and pages rigorously: reqDTO.pageNo/pageSize (page size 100), aggregating until total is reached.
  • Boundaries: an empty page stops early even if total claims more; a 100-page guard raises a bilingual error instead of silently truncating; an unrecognized response shape (no list) falls back to the legacy single-page listWorkspaces read. Server errors still propagate untouched.
  • Duplicate rows are intentionally kept so identity resolution still rejects ambiguous workspace mappings (existing safety contract).
  • bl workspace list --dry-run preview shows the real first-page request and pagination plan; workspace identity previews point at the new API.
  • No flag / help / reference changes; no version bump in this PR (release prep can be appended here).

Verification

  • Live (browser console login + local source build): bl workspace list returns all 30/30 unique workspaces on an account that previously showed only 10; cross-page identity resolution verified with bl log audit count --workspace-id <30th workspace> (resolves tenantId from page 3 and completes the business query).
  • 7 pagination contract cases in packages/commands/tests/e2e/log.e2e.test.ts (multi-page aggregation + pageNo progression, single-page stop, legacy-shape fallback, empty-page early stop, non-convergence guard, dry-run zero-network, cross-page identity resolution); mocks updated to the new API contract across telemetry / alert / console-read / catalog output suites.
  • All affected suites green: 1157/1157 (log.e2e 103, telemetry 79, console-read.e2e 102, alert-output 187, catalog-workspace-permission-output 150, console-read-output 107, telemetry-output 226, usage-output 177, core console-response 26). Suite wall times: log.e2e ~4.1s, console-read.e2e ~0.9s, others <0.6s each.
  • vp check: 0 errors (2 pre-existing unrelated warnings). Node v22.23.0, default workers.

…ns all workspaces

bl workspace list only returned the gateway's default first page (10 rows) even for accounts with more workspaces, and console workspace identity resolution could not resolve spaces beyond that page. Live probing plus the maas-x API registry confirm the zelda space.listWorkspaces service has no pagination inputs; the console frontend pages via the BailianControl POP layer, which the CLI gateway does not expose.

listConsoleWorkspaces now calls space.listMyWorkSpaces with reqDTO.pageNo/pageSize (page size 100) and aggregates pages until total is reached. An empty page stops early, a 100-page guard raises instead of silently truncating, and an unrecognized response shape falls back to the legacy single-page read; server errors propagate untouched. Duplicate rows are kept so identity resolution still rejects ambiguous mappings. Dry-run and identity previews show the new API and first-page request. Verified live after browser console login: 30/30 unique workspaces listed and a third-page workspace resolves for log audit count.
@lishengzxc lishengzxc changed the title fix(workspace): page through listMyWorkSpaces so workspace list returns all workspaces fix(workspace): page through listMyWorkSpaces so workspace list returns all workspaces (prepare 2.10.3) Nov 18, 2026
@XXPermanentXX
XXPermanentXX merged commit 55a5eec into main Nov 18, 2026
7 checks passed
@XXPermanentXX
XXPermanentXX deleted the fix/workspace-list-pagination branch November 18, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants