You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/sdk-integrations/SKILL.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,28 @@ Assert on emitted spans (not just provider return values):
263
263
264
264
For streaming, assert both the provider iterator/async-iterator still works AND the final span has aggregated `output` + stream-specific `metrics`.
265
265
266
+
### Streaming lifecycle review
267
+
268
+
Review every exit path, not just full consumption. Check the real provider's
269
+
iterator, context-manager, cancellation, and garbage-collection behavior before
270
+
choosing a wrapper. A proxy can preserve transport cleanup while still losing
271
+
the span's final output and end time.
272
+
273
+
- Cover exhaustion, provider errors, explicit close/cancel, and context-manager
274
+
exit where the provider supports it. Preserve exception and return semantics.
275
+
- Cover `break` followed by dropping the last stream reference, and dropping a
276
+
stream before consuming any chunks. `break` alone does not close a retained
277
+
iterator; do not promise immediate finalization while callers still hold it.
278
+
- Use existing recordings for partial-consumption tests. Drop the proxy, force
279
+
collection, and assert partial (or empty) output, `metrics.end`, correct
280
+
parentage, and no duplicate finalization after explicit close or exhaustion.
281
+
- A GC fallback must not retain the stream through its callback or closure.
282
+
For async streams, do not run or schedule event-loop work from a finalizer;
283
+
finalize trace state and preserve the provider's own cleanup behavior.
284
+
- Check that neither iteration nor cleanup leaves the stream span current in
285
+
the caller's context. GC is a best-effort fallback, not a substitute for
286
+
deterministic cleanup when the caller explicitly closes the stream.
287
+
266
288
Cassettes live in `integrations/<provider>/cassettes/<version>/` (e.g. `cassettes/latest/`, `cassettes/0.48.0/`). Nox sets `BRAINTRUST_TEST_PACKAGE_VERSION` so cassettes land correctly. Do not add per-test `vcr_cassette_dir` / `cassette_library_dir` fixtures — `integrations/conftest.py` handles it. Re-record only when behavior intentionally changed. Sanitize binary media in both request and response bodies so checked-in cassettes do not retain large base64 payloads.
267
289
268
290
Confirm the exact session name from `noxfile.py` — don't assume it matches the folder.
0 commit comments