Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BOT ISSUE] OpenAI Responses API instrumentation uses wrong token-limit parameter name and is missing several metadata fields

未关闭
#145 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
ruby
领域
observability

调研方向

先从 lib/braintrust/contrib/openai/instrumentation/responses.rb 和 lib/braintrust/contrib/ruby_openai/instrumentation/responses.rb 中的 METADATA_FIELDS 开始,然后将其与 lib/braintrust/contrib/openai/instrumentation/chat.rb 以及 upstream 的 ResponseCreateParams 定义进行比较。确认 Responses instrumentation 的元数据与文档记录的参数名称一致,并包含 issue 中列出的所有字段。

由索引模型根据 Issue 内容生成。

描述

Summary

The Responses API instrumentation in both the openai and ruby-openai integrations has an incorrect parameter name (max_tokens instead of max_output_tokens) and is missing several parameters that are part of the stable upstream API. Users who set max_output_tokens, service_tier, include, text, or background on their Responses API calls get no visibility into these values in their Braintrust span metadata.

What is missing

The METADATA_FIELDS constant in both Responses API instrumentations currently includes:

METADATA_FIELDS = %i[
  model instructions modalities tools parallel_tool_calls
  tool_choice temperature max_tokens top_p frequency_penalty
  presence_penalty seed user metadata store response_format
  reasoning previous_response_id truncation
].freeze
Wrong parameter name
Current field Correct field Why it matters
max_tokens max_output_tokens The Responses API uses max_output_tokens, not max_tokens. The SDK captures a field that doesn't exist in the Responses API, and misses the one users actually pass.
Missing parameters
Parameter Why it matters
service_tier Controls processing priority (auto, default, flex, priority). Already captured in the Chat Completions instrumentation — this is an inconsistency within the SDK.
include Array controlling what additional data is returned (e.g., web_search_call.action.sources, code_interpreter_call.outputs). Important for understanding what data the user requested.
text Text response format configuration for structured outputs. The newer alternative to response_format for the Responses API.
background Boolean for async/background response execution. Changes how the response is processed — users need to see this in traces to understand response behavior.

Braintrust docs status

not_found — The Braintrust docs at https://www.braintrust.dev/docs/instrument/wrap-providers do not mention max_output_tokens, service_tier, include, text, or background for the Responses API.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib/openai/instrumentation/responses.rb (lines 26–31) — METADATA_FIELDS uses max_tokens (wrong) and is missing max_output_tokens, service_tier, include, text, background
  • lib/braintrust/contrib/ruby_openai/instrumentation/responses.rb (lines 32–37) — identical METADATA_FIELDS, same issues
  • lib/braintrust/contrib/openai/instrumentation/chat.rb (lines 27–32) — Chat Completions already captures service_tier, showing this is an oversight in the Responses instrumentation
主要语言
Ruby
星标
9
派生
11
平均合并
3 天 43 分钟
30 天内合并 PR
9

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

braintrustdata/braintrust-sdk-ruby 的其他 Issue

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

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。