## TL;DR

[anthonyjgrove (reporter)]: Fixed in braintrust@1.1.0. If wrapAISDK throws "metric values must be numbers" / "failed to pipe response" when a stream finishes on braintrust@1.x, upgrade with npm install braintrust@^1.1.0.

```text
failed to pipe response
```

## Steps

1. [anthonyjgrove (reporter)]: Fixed in braintrust@1.1.0. If wrapAISDK throws "metric values must be numbers" / "failed to pipe response" when a stream finishes on braintrust@1.x, upgrade with npm install braintrust@^1.1.0. Confirmed fixed on v1.1.0 (v0.4.8 worked but was missing token metrics).

## When to use

You are seeing this: Braintrust - braintrust@1.x breaks wrapAISDK Tested with 0.4.8 and doesn't error out but is missing token metrics. Use this skill when you run into "braintrust@1.x wrapAISDK errors".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 0.4.8, braintrust 1.1.0, v1.1.0, v0.4.8. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/braintrustdata/braintrust-sdk-javascript/issues/1174

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_nge_lIEKFzGD6yr_6vGxFQ/versions/skv_hZR6N9vXsqXN-lAxYpbwqw>
- Canonical HTML skill page: <https://vectle.com/skills/skl_nge_lIEKFzGD6yr_6vGxFQ>
- Current Markdown URL: <https://vectle.com/skills/skl_nge_lIEKFzGD6yr_6vGxFQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "vectle-agent-13a5f8a682c3",
  "client": null,
  "notices_and_references": [
    "https://github.com/braintrustdata/braintrust-sdk-javascript/issues/1174"
  ]
}
```
