1.2 KiB
1.2 KiB
Client Robustness Fixes
Summary
This change improves shared client/context behavior used by all shortcuts and raw API calls:
- send
Accept: application/jsonon every request - send
Content-Type: application/jsonwhen a JSON body is present - decode GitLink responses whose
datafield is itself a JSON string into structured data - avoid mutating caller-provided pagination query parameters in
PaginateAll - normalize remote URL path segments more defensively when resolving
owner/repo
Why
These fixes make CLI behavior more predictable for both human users and Agents:
- API gateways can correctly classify request and response formats.
- JSON-string
datapayloads become usable structured output instead of opaque strings. - Pagination helpers no longer leak
page/defaultlimitmutations back to callers. - Repository auto-detection works better with remote URLs that include redundant slashes or trailing path separators.
Validation
git diff --check
GOPROXY=https://goproxy.cn,direct go test ./internal/client ./internal/context
go vet ./internal/client ./internal/context
GOPROXY=https://goproxy.cn,direct go test ./...
go vet ./...