Skip to content

installProviderCli fails on native Response #3466

Description

@iamhenry

What happened

A plugin calling bb.sdk.hosts.installProviderCli(...) fails with:

this[getResponseCache] is not a function

The provider CLI remains unchanged. The exception prevents the SDK from returning the installer events to the plugin.

Observed with:

  • BB 0.42.2-nightly.34486466131.1
  • Plugin SDK runtime artifact 0.4.53
  • Node 22.23.2
  • macOS

What should happen

installProviderCli should read the native Fetch Response, parse its newline-delimited installer events, and return them to the plugin.

Repro

  1. From a BB plugin server, call:

    await bb.sdk.hosts.installProviderCli({
      hostId,
      provider,
      actionKind: "update",
    });
  2. Let the host installer endpoint return its response.

  3. Observe TypeError: this[getResponseCache] is not a function instead of parsed installer events.

Evidence

packages/sdk/src/areas/hosts.ts currently reads the response with:

const text = await Response.prototype.text.call(response);

In the bundled server runtime, Response is BB's lightweight wrapper. Its text() implementation calls a private symbol method named getResponseCache. The response returned by the transport is a native Fetch Response, which does not contain that wrapper-specific symbol. Applying the wrapper prototype method to the native response therefore throws this exact exception.

The same source is visible at:

https://github.com/get-bb/bb/blob/main/packages/sdk/src/areas/hosts.ts

The idiomatic fix appears to be:

const text = await response.text();

This preserves the public SDK boundary and lets each response use its own implementation. A focused regression test should have installProviderCli consume a native Response containing newline-delimited installer events and assert that it returns the parsed events.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportpluginsPlugin SDK, runtime, marketplace

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions