OpenAI Responses streams that end incomplete or failed are logged without token metrics
Maintainer thường phản hồi trong vòng 1 ngày
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
- 77/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
Bắt đầu tại py/src/braintrust/integrations/openai/tracing.py, ở ResponseWrapper._postprocess_streaming_results, rồi lần theo cách response.completed cung cấp thông tin sử dụng và đầu ra trong cả hai nhánh. Kiểm tra cách các sự kiện kết thúc response.incomplete và response.failed cung cấp phản hồi cuối cùng, sau đó tái hiện bằng lệnh gọi streaming đã cung cấp. Hoàn tất khi các sự kiện kết thúc này ghi lại các chỉ số token và đầu ra cuối cùng, đồng thời có cassette đã ghi lại bao quát hành vi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
ResponseWrapper._postprocess_streaming_results (py/src/braintrust/integrations/openai/tracing.py) reads the final response only from response.completed. That event's response.usage populates the metrics, and its response.output becomes the logged output.
A Responses stream can also end on response.incomplete (for example when max_output_tokens is reached) or response.failed. Both events carry the same final response, with its usage and output. For those streams:
- no token metrics are logged: the intermediate events carry no usage, and the terminal response's usage is only read for
response.completed - the logged output is the partial reconstruction from the deltas, not the final
response.output
Repro: client.responses.create(model="gpt-4.1", input="Write a long essay", max_output_tokens=16, stream=True) with the wrapped client. The stream ends on response.incomplete and the span has no prompt_tokens/completion_tokens metrics.
Suggested fix: handle response.incomplete and response.failed the same way as response.completed in both branches. I'm happy to send a PR with a recorded cassette if that works for you.
This issue was written with help from an AI coding assistant (Claude Code); the code path above was checked on main.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 27
- Merge trung bình
- 14 giờ 49 phút
- Pull request đã merge (30 ngày)
- 126
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-python
-
Temporal: add `workflow.Info.original_execution_run_id` to workflow span metadataCó thể đã có người làm @Ehsan-hash đã nhận 1 ngày trước. Đang mởfeature python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
braintrustdata/braintrust-sdk-python#868 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
braintrustdata/braintrust-sdk-python#957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
python
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
braintrustdata/braintrust-sdk-python#956 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
python
braintrustdata/braintrust-sdk-python#839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
new-integration
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
braintrustdata/braintrust-sdk-python#808 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của braintrustdata/braintrust-sdk-python
Issue tương tự
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustĐang mởbug sev-3 vm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sierra-research/tau2-bench#635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python onesCó thể đã có người làm @fmuia đã nhận hôm nay. Đang mởdocumentation skill
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
lnccbrown/ssm-simulators#406 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
btclib-org/btclib-ecc#309 ·
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 74/100
autowarefoundation/autoware_carla_scenario#281 ·
Maintainer thường phản hồi trong vòng 1 ngày