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 5694357
Browse filesBrowse the repository at this point in the historyBrowse files
fix(anthropic): enforce provider privacy and prevent stray child rows on batch completion
> 🤖 **This text was AI-generated.**
### Problem
1. `complete_anthropic_batch_trace` / `complete_anthropic_batch_trace_async` wrote
completion updates via `update_span()` without applying the active
`provider_content_allowed` privacy policy, allowing `output`, `error`, and
content-bearing `metadata` through when provider content capture is disabled.
2. In saved-context mode (where only `request_count` and `request_ids_digest` are stored),
an unknown `custom_id` in `results` wrote a child `update_span` row before
`_finalize_task_span` rejected the batch on digest mismatch.
### Solution
- Added `_apply_provider_privacy()` to redact `input`, `output`, `error`, and non-`model`/`provider`
`metadata` keys on child and task completion updates when `provider_content_allowed` is false.
- In saved-context mode (`known_ids is None`), stage validated child update payloads and
only flush them once `seen_ids` matches `request_count` and `request_ids_digest`, so
unknown/incomplete result sets never emit stray child rows.
- Added VCR-backed assertions covering both cases in `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