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
{{ message }}
Repository navigation
Commit 47cab3b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(anthropic): spool staged batch updates to disk and add test polling deadlines
> 🤖 **This text was AI-generated.**
### Problem
1. In saved-context mode (`known_ids is None`), staging child span updates in an in-memory
list kept all response bodies in RAM until stream completion, which could exhaust worker
memory on large batches.
2. Two batch lifecycle tests polled `messages.batches.retrieve()` without the 15-minute
deadline check when re-recording cassettes.
### Solution
- Replaced the in-memory `pending_updates` list in `complete_anthropic_batch_trace` and
`complete_anthropic_batch_trace_async` with `tempfile.SpooledTemporaryFile` (spilling to
disk above 1 MB and streaming back line-by-line via `bt_dumps` / `json.loads` only after
`request_count` and `request_ids_digest` match).
- Restored the 15-minute polling deadline in `test_collect_only_mode_under_active_parent`
and `test_incomplete_and_invalid_context_handling`.
Co-authored-by: Abhijeet Prasad <abhijeet@braintrustdata.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0 commit comments