Skip to content

workflow inspect runs --backend vercel: 'Failed to parse response body' on gzip-compressed /v2/runs response #2485

@Lemirq

Description

@Lemirq

Summary

npx workflow inspect runs --backend vercel fails to parse the API response body. The response appears to be gzip-compressed (note the \x1f\x8b gzip magic bytes rendered as and the Content-Type: unknown), but the CLI tries to JSON.parse the raw, undecoded bytes — producing a SyntaxError.

Steps to reproduce

npx workflow inspect runs --backend vercel

Output

┌───────────────────────────────────────────────────────────────┐
│                     Workflow CLI v4.2.10                       │
│   Docs at https://useworkflow.dev/                            │
└───────────────────────────────────────────────────────────────┘
[Info] Vercel project detected. Loading project data...
[Error] Error: Failed to parse response body for GET /v2/runs?limit=20&sortOrder=desc&remoteRefBehavior=lazy (Content-Type: unknown):

SyntaxError: Unexpected token '�', "�ddata��"... is not valid JSON

Analysis

  • The leading bytes (�ddata) are consistent with a gzip-compressed payload (0x1f 0x8b).
  • Content-Type: unknown suggests the response lacks/loses its content-type header, so the CLI never branches into a decompress-then-parse path and instead feeds the compressed bytes straight to JSON.parse.
  • Likely fix: have the HTTP client honor Content-Encoding: gzip (decompress before parsing), or send Accept-Encoding: identity for these requests.

Environment

  • Workflow CLI: @workflow/cli/4.2.10 (also reproduced under newer workflow packages)
  • Node: v26.3.0
  • Platform: darwin-arm64
  • Backend: --backend vercel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions