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

[bot] OpenAI Agents API (`client.beta.agents.sessions`) not instrumented

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
ruby

调研方向

Start with lib/braintrust/contrib/openai/patcher.rb and the existing instrumentation in lib/braintrust/contrib/openai/instrumentation/chat.rb and responses.rb. Check registration in lib/braintrust/contrib.rb, then define the Agents session instrumentation around create_streaming and the session lifecycle. Done means agent input, session metadata, streamed output, and available usage and latency are captured consistently.

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

描述

ruby

Summary

The official openai Ruby gem now ships a top-level Agents API (client.beta.agents.sessions) — a managed, long-running agent session surface distinct from Chat Completions, the Responses API, and the already-tracked Realtime API (#206). It was added to the gem in v0.90.0 (2026-09-10, "api: add Agents API"), with immediately-following releases adding more capability: v0.91.0 ("add agent session model settings"), v0.96.0 ("add Agents credential and session options"), and v0.97.0 (2026-09-29, "add computer use to beta agents"). This is a genuinely new generative/agentic execution surface with zero instrumentation in this repo today.

What is missing

client = OpenAI::Client.new

events = client.beta.agents.sessions.create_streaming(
  agent: {
    model: "gpt-6-astra",
    instructions: "Write clean code, run it, and report the actual output."
  },
  environment: { type: "openai_hosted" },
  input: "Create tree.py, ..."
)

events.each { |event| puts JSON.generate(event.to_h) }
events.close

client.beta.agents.sessions.delete(session_id)
  • client.beta.agents.sessions.create_streaming(agent:, environment:, input:, ...) — starts a managed agent session and streams turn/tool-execution events (agent.session.turn.completed, turn.failed, turn.cancelled, session.failed, agent.session.idle, etc.). This is the generation-initiating call — analogous to responses.create/chat.completions.create for this API family, but the agent runs (and can use hosted tools, including a newly-added "computer use" tool per v0.97.0) server-side across multiple turns.
  • client.beta.agents.sessions.delete(session_id) — session teardown (lifecycle management, not itself generative, included only for context).

No Patcher in this repo wraps any of this: lib/braintrust/contrib/openai/patcher.rb defines only ChatPatcher, ResponsesPatcher, and ModerationsPatcher.

What a span should capture
  • Input: agent config (model, instructions), environment, input task
  • Metadata: provider (openai), session id, model, environment type
  • Output: aggregated turn events / final session state
  • Metrics: token usage per turn if exposed by the event stream, latency to session completion

Braintrust docs status

supported for TypeScript/Python, not_found for Ruby — https://www.braintrust.dev/docs/integrations/sdk-integrations documents startOpenAIAgentsTrace, updateOpenAIAgentsTrace, failOpenAIAgentsTrace, and an openai.agents.sessions.create span for TypeScript and Python under "OpenAI Agents SDK"/agent framework tracing. https://www.braintrust.dev/docs/integrations/ai-providers/openai's Ruby-specific span table lists only chat.completions.create/stream, responses.create/stream, and moderations.create — no Agents API entry anywhere for Ruby. This is a clear cross-language parity gap, not just an unreleased feature.

Upstream sources

Braintrust docs sources checked

Local repo files inspected

  • lib/braintrust/contrib/openai/patcher.rb — defines ChatPatcher, ResponsesPatcher, ModerationsPatcher; no agents/session patcher
  • lib/braintrust/contrib/openai/instrumentation/ — contains chat.rb, responses.rb, moderations.rb, common.rb; no agents.rb
  • lib/braintrust/contrib.rb — registers only ChatPatcher/ResponsesPatcher/ModerationsPatcher for the OpenAI integration
  • Grep for agents, beta.agents, Agents API across lib/braintrust/ returns zero relevant matches
主要语言
Ruby
星标
9
派生
10
平均合并
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 摘要。