Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

已關閉
#860 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@AbhiPrasad 已經在處理了。

開始於 2026年10月8日。

  • #893 來自 @AbhiPrasad —— 已合併

評估

難度
3/5
預估耗時
1-2 天
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
observability

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Python
星號
21
分支
23
平均合併
19 小時 23 分鐘
30 天內合併 PR
97

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

braintrustdata/braintrust-sdk-python 的其他 Issue

查看 braintrustdata/braintrust-sdk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。