Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Fechada
#860 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@AbhiPrasad já está trabalhando nisso.

Desde 8/10/2026.

  • #893 de @AbhiPrasad — integrado

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
74/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
observability

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
22
Forks
27
Merge médio
11h 46min
PRs com merge (30d)
137

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de braintrustdata/braintrust-sdk-python

Todas as issues de braintrustdata/braintrust-sdk-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.