Skip to content

fix(cli): decode caches list as bare array (#290)#291

Merged
DerDennisOP merged 1 commit into
mainfrom
fix/issue-290-cache-list-output
May 29, 2026
Merged

fix(cli): decode caches list as bare array (#290)#291
DerDennisOP merged 1 commit into
mainfrom
fix/issue-290-cache-list-output

Conversation

@DerDennisOP
Copy link
Copy Markdown
Member

@DerDennisOP DerDennisOP commented May 29, 2026

Summary

  • gradient cache list printed api error (200): {...} instead of formatting the cache list.
  • Root cause: GET /caches returns message as a bare array (server, docs, and frontend all agree), but the CLI connector's caches().list() decoded Paginated<Vec<ListItem>> — a copy of the orgs/projects pattern. The shape mismatch made decode<T> fail to parse the envelope and fall through to the raw-body error path, rendering a successful 200 as an api error.
  • Fix: caches().list() now returns ListResponse (Vec<ListItem>), matching the documented ListResponse contract; the cache list command iterates the Vec directly (mirroring orgs subscriptions).

No server, API-doc, or frontend changes needed — they already use the bare-array contract; only the connector was the outlier.

Fixes #290

Test plan

  • cargo test -p connector --test caches_apilist_caches_decodes_bare_array replays the exact response from the bug report and asserts it decodes into a Vec.
  • Manual: gradient cache list against a server with at least one cache prints name: id lines instead of an api error (200).

@DerDennisOP DerDennisOP merged commit 6c83010 into main May 29, 2026
7 checks passed
@DerDennisOP DerDennisOP deleted the fix/issue-290-cache-list-output branch May 29, 2026 12:55
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.

wrong output on gradient cache list

1 participant