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
Anthropic: test_anthropic_beta_messages_create_captures_compaction_metadata can't be re-recorded #864
While re-recording the latest anthropic cassettes for #849 (anthropic 1.11.0), test_anthropic_beta_messages_create_captures_compaction_metadata in py/src/braintrust/integrations/anthropic/test_anthropic.py failed:
The live API now stops with max_tokens instead of compaction for that short prompt (claude-opus-5, max_tokens=512, compaction={"type": "summarize"}, beta compact-2026-09-04). The old cassette was kept, so playback still passes, but the test can't be re-recorded as written.
Fix
Update the prompt and/or max_tokens so the API reliably triggers compaction, or relax the stop_reason assertion if the test only needs to verify the compaction metadata is captured. Then re-record cassettes/latest/test_anthropic_beta_messages_create_captures_compaction_metadata.yaml.
Parent: #858 (found while reviewing the 2026-10-05 weekly dependency update, #849).
Activity
test(anthropic): allow variable compaction stop reasons (braintrustda…