Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

OpenRouter: GA `client.responses` is not traced by `wrap_openrouter()`, and `client.beta.responses` is not auto-instrumented

Đã đóng
#860 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@AbhiPrasad đang làm issue này rồi.

Từ ngày 8/10/2026.

  • #893 của @AbhiPrasad — đã merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
observability

Hướng nghiên cứu

Start with py/src/braintrust/integrations/openrouter/patchers.py and tracing.py, then compare the existing GA Responses patching with BetaResponses and the behavior for OpenRouter 0.6.0. Add the requested cassette-backed client.responses.send coverage and a Responses check in test_auto_openrouter.py; done when GA calls through wrapped clients and beta calls through auto-instrumentation are traced without breaking 0.6.0.

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

Mô tả

bug python

In current openrouter releases (1.2.32 and 1.3.22), client.responses is the GA openrouter.responses.Responses, while client.beta.responses is a separate, deprecated openrouter.beta_responses.BetaResponses.

  • wrap_openrouter() in py/src/braintrust/integrations/openrouter/tracing.py only wraps client.beta.responses, so GA client.responses.send / send_async calls are never traced on wrapped clients.
  • auto_instrument() patches the GA Responses class but not BetaResponses, so client.beta.responses.send is never traced there.

Fix

  • In py/src/braintrust/integrations/openrouter/patchers.py, add patchers for BetaResponses.send / send_async, applied only when openrouter.beta_responses exists (so 0.6.0 keeps working).
  • Make wrap_openrouter() also wrap client.responses.
  • Add a cassette-backed client.responses.send test, and a Responses check in test_auto_openrouter.py (it only covers chat today).
  • Optional: add the new alignment field to _RESPONSES_RESPONSE_KEYS.

Parent: #858 (found while reviewing the 2026-10-05 weekly dependency update, #849).

🤖 Generated with Claude Code

Ngôn ngữ chính
Python
Star
21
Fork
23
Merge trung bình
19 giờ 23 phút
Pull request đã merge (30 ngày)
97

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-python

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

Issue tương tự

Thêm issue về Python

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.