[bot] OpenAI Responses API `compact()` (server-side conversation compaction) not instrumented

Đang mở Phù hợp với người mới
#236 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
78/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

Bắt đầu bằng cách đọc lib/braintrust/contrib/openai/instrumentation/responses.rb và lib/braintrust/contrib/openai/patcher.rb, sau đó so sánh phần instrumentation hiện có của create và stream. Bổ sung kiểm thử cho lệnh gọi compact thông qua đường dẫn patching Responses hiện có, đồng thời kiểm tra các bài kiểm thử liên quan đến spans, đầu ra đã compact và mức sử dụng. Hoàn tất khi client.responses.compact(params) tạo ra một trace có đầu vào, đầu ra và mức sử dụng token của lệnh gọi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

<!-- provider-gap-audit: openai-responses-compact-not-instrumented -->

Summary

The official openai Ruby gem's Responses resource exposes a stable compact method (client.responses.compact(params)) that invokes the model to compact/summarize a long-running conversation and returns an OpenAI::Models::Responses::CompactedResponse. This is a model-execution call — billed, and producing a model-generated summary — not a CRUD/admin operation. It is not instrumented anywhere in this repo: only create and stream are wrapped for the Responses API.

What is missing

  • OpenAI::Resources::Responses#compact is not wrapped by Instrumentation::Responses and is not patched by ResponsesPatcher.
  • No span is created, so a compaction call produces zero trace: no input, no output (the compacted summary), no token usage/cost for the compaction call itself.

Braintrust docs status

supported (in another Braintrust SDK, not Ruby) — https://docs.braintrust.dev/integrations/ai-providers/openai explicitly lists, in the TypeScript SDK's Responses API span table: openai.responses.compact ↔ responses.compact (OpenAI SDK v6.10.0 or later). The same page's Ruby-relevant sections only reference create, parse, and stream variants — compact is absent for Ruby (and for Python/Go/Java/.NET). This is a concrete Ruby-specific parity gap against Braintrust's own TypeScript instrumentation of the identical upstream capability.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/openai/instrumentation/responses.rb — Instrumentation::Responses::InstanceMethods defines only create (line 35) and stream (line 59); no compact
  • lib/braintrust/contrib/openai/patcher.rb — ResponsesPatcher#perform_patch (lines 94–111) includes Instrumentation::Responses into ::OpenAI::Resources::Responses/the target's singleton class, but the module itself has no compact wrapper, so calls pass straight to super untraced
  • lib/braintrust/contrib/openai/integration.rb — confirms ResponsesPatcher is the sole patcher registered for the Responses API surface
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của braintrustdata/braintrust-sdk-ruby

Tất cả issue của braintrustdata/braintrust-sdk-ruby

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.