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:
assert response.stop_reason == "compaction"
AssertionError: assert 'max_tokens' == 'compaction'
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).
🤖 Generated with Claude Code
While re-recording the
latestanthropic cassettes for #849 (anthropic 1.11.0),test_anthropic_beta_messages_create_captures_compaction_metadatainpy/src/braintrust/integrations/anthropic/test_anthropic.pyfailed:The live API now stops with
max_tokensinstead ofcompactionfor that short prompt (claude-opus-5,max_tokens=512,compaction={"type": "summarize"}, betacompact-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_tokensso the API reliably triggers compaction, or relax thestop_reasonassertion if the test only needs to verify thecompactionmetadata is captured. Then re-recordcassettes/latest/test_anthropic_beta_messages_create_captures_compaction_metadata.yaml.Parent: #858 (found while reviewing the 2026-10-05 weekly dependency update, #849).
🤖 Generated with Claude Code