[bot] Anthropic Beta Messages `compaction` parameter (on-demand compaction) not captured in span metadata
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- ruby
- Lĩnh vực
- observability
Hướng nghiên cứu
Đọc lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb, tập trung vào METADATA_FIELDS, BETA_METADATA_FIELDS và capture_beta_fields; lib/braintrust/contrib/anthropic/patcher.rb xác định điểm tích hợp. Thêm việc thu thập metadata của request cho compaction trong beta instrumentation, sau đó kiểm tra các bài test beta Messages instrumentation hiện có để xác nhận trường này xuất hiện trong các request compaction. Issue không nêu tên file test nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
<!-- provider-gap-audit: anthropic-compaction-param-not-captured -->
Summary
Anthropic's compact-2026-09-04 beta (released September 2026) lets callers trigger on-demand compaction of a conversation via a top-level compaction request parameter on client.beta.messages.create, returning a signed compaction block (stop_reason: "compaction", a summary in content, and a signature) in place of a normal reply. This is a distinct, documented execution mode of the beta Messages API. The compaction parameter is not captured anywhere in this repo's Anthropic beta instrumentation.
What is missing
BetaMessages::InstanceMethods::METADATA_FIELDSandBETA_METADATA_FIELDSdo not includecompaction, so a request that sets it is traced identically to a normal message request — the metadata gives no indication the call was a compaction request.capture_beta_fieldsexplicitly special-casesbetasandoutput_formatbut has no equivalent handling forcompaction.- The response's
stop_reason: "compaction"is still captured generically viafinalize_metadata's existingstop_reasonhandling, but without the request-sidecompactionfield, there's no way to see why a compaction response was produced versus e.g. hitting a stop sequence.
Braintrust docs status
supported (in another Braintrust SDK, not Ruby) — https://docs.braintrust.dev/integrations/ai-providers/anthropic documents, for the Python SDK, that Messages spans capture request parameters including compaction, context_management, and diagnostics, and separately that OTel export sums anthropic.compaction spans for token accounting. The Ruby-specific sections of the same page describe no equivalent compaction metadata capture — this is a concrete Ruby-specific parity gap against Braintrust's own Python instrumentation of the identical upstream beta.
Upstream sources
- Anthropic Claude Platform release notes: on-demand compaction, beta header
compact-2026-09-04(September 2026) — https://platform.claude.com/docs/en/release-notes/overview - Anthropic Messages API reference (beta):
compactionrequest parameter — https://platform.claude.com/docs/en/api/beta/messages/create - Official
anthropicRuby SDK release 1.71.0: "feat(api): add compaction parameter and signed compaction blocks (beta)" — https://github.com/anthropics/anthropic-sdk-ruby/pull/235 anthropic-sdk-rubyhelpers.mddocuments thecompact-2026-09-04beta header and the resulting message'sstop_reason: :compaction/message.content.first.contentshape — https://github.com/anthropics/anthropic-sdk-ruby/blob/main/helpers.md
Local repo files inspected
lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb—METADATA_FIELDS(lines 29–32),BETA_METADATA_FIELDS(lines 35–37), andcapture_beta_fields(lines 146–166) have nocompactionhandlinglib/braintrust/contrib/anthropic/instrumentation/messages.rb— stable (non-beta)METADATA_FIELDS(lines 25–28), shown for contrast;compactionis beta-only upstream so this file is unaffectedlib/braintrust/contrib/anthropic/patcher.rb— confirmsBetaMessagesPatcheris the integration point that would need the added field
- Ngôn ngữ chính
- Ruby
- Star
- 9
- Fork
- 11
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của braintrustdata/braintrust-sdk-ruby
-
[bot] OpenAI Responses API `compact()` (server-side conversation compaction) not instrumentedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[BOT ISSUE] OpenAI Chat Completions missing reasoning model and web search metadata parametersĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
Tất cả issue của braintrustdata/braintrust-sdk-ruby
Issue tương tự
-
Websockify heartbeat for vnc_containerCó thể đã có người làm @robinkar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
metanorma/metanorma-cli#494 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: a killed mutant is scored errored when the failing test's message contains binary bytesĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
davidteren/mutineer#434 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày