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
-
From a BB plugin server, call:
await bb.sdk.hosts.installProviderCli({
hostId,
provider,
actionKind: "update",
});
-
Let the host installer endpoint return its response.
-
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.
What happened
A plugin calling
bb.sdk.hosts.installProviderCli(...)fails with:The provider CLI remains unchanged. The exception prevents the SDK from returning the installer events to the plugin.
Observed with:
0.42.2-nightly.34486466131.10.4.5322.23.2What should happen
installProviderClishould read the native FetchResponse, parse its newline-delimited installer events, and return them to the plugin.Repro
From a BB plugin server, call:
Let the host installer endpoint return its response.
Observe
TypeError: this[getResponseCache] is not a functioninstead of parsed installer events.Evidence
packages/sdk/src/areas/hosts.tscurrently reads the response with:In the bundled server runtime,
Responseis BB's lightweight wrapper. Itstext()implementation calls a private symbol method namedgetResponseCache. The response returned by the transport is a native FetchResponse, 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:
This preserves the public SDK boundary and lets each response use its own implementation. A focused regression test should have
installProviderCliconsume a nativeResponsecontaining newline-delimited installer events and assert that it returns the parsed events.