Skip to content

bug: stream error responses are corrupted with commas due to Array.toString() in GaxiosError (AIP-193) #8768

Description

@jerrylin3321

Please make sure you have searched for information in the following guides.

Library Name

gaxios

A screenshot that you have tested with "Try this API".

N/A

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/jerrylin3321/8fb4131dc2df1bce696f94fac77d90a5

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Initialize a new Node.js project and install gaxios v7 (e.g., npm install gaxios@7.1.3).
  2. Save the reproduction script as reproduce.js.
  3. Run the script using node reproduce.js.
  4. Observe that the stringified response data contains a stray comma (e.g., "Invalid ,argument") injected at the chunk boundary.

A clear and concise description of what the bug is, and what you expected to happen.

See this downstream issue that it is causing in gemini-cli: google-gemini/gemini-cli#21884

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

Regression introduced in v7.0.0 via PR #699

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