Skip to content

[bot] Anthropic Managed Agents API (beta.sessions.events.send / stream) not instrumented in JavaScript SDK #2106

@braintrust-bot

Description

@braintrust-bot

Summary

The Anthropic Managed Agents API (beta.agents.* / beta.sessions.*) launched in public beta on April 8, 2026 and is available in @anthropic-ai/sdk v0.104.0 (June 9, 2026). The Braintrust Anthropic integration docs list anthropic.beta.agents.* and anthropic.beta.sessions.* as supported, but the JavaScript SDK has zero instrumentation for any of these surfaces — no channels, no auto-instrumentation config, no wrapper proxy. Users building managed agent applications with the Anthropic SDK get no Braintrust spans.

What instrumentation is missing

The key generative execution surfaces in the Managed Agents API:

SDK Method Description
client.beta.sessions.events.send({ sessionId, body }) Sends a user message (or tool result) to a session, triggering managed agent inference
client.beta.sessions.events.stream({ sessionId }) Streams session events (model responses, tool calls, tool results, state transitions) as SSE

These two methods are the core agentic execution surface — they trigger model inference and return or stream generated content. The session/agent CRUD methods (create, list, get, archive) are management operations excluded here.

No coverage in any instrumentation layer:

  • Auto-instrumentation config (js/src/auto-instrumentations/configs/anthropic.ts): Only 4 entries covering Messages.create (2 SDK layout variants) and beta.Messages.create / beta.Messages.toolRunner. No beta.Sessions or beta.Agents entries.
  • Channels (js/src/instrumentation/plugins/anthropic-channels.ts): Only 3 channels defined — messagesCreate, betaMessagesCreate, betaMessagesToolRunner. No managed agent channels.
  • Wrapper (js/src/wrappers/anthropic.ts): No proxy for beta.agents or beta.sessions properties.
  • Vendor types (js/src/vendor-sdk-types/anthropic.ts): No type definitions for BetaAgents or BetaSessions.

A grep for beta.agents, beta.sessions, or managed-agents across js/src/ returns zero matches.

Braintrust docs status

supported — The Braintrust Anthropic integration page at https://www.braintrust.dev/docs/integrations/ai-providers/anthropic explicitly lists anthropic.beta.agents.* and anthropic.beta.sessions.* as supported features, implying JavaScript instrumentation parity is expected.

Upstream references

  • Anthropic Managed Agents announcement: https://www.anthropic.com/news/agent-capabilities-api (April 8, 2026)
  • Managed Agents API beta header: anthropic-beta: managed-agents-2026-04-01
  • @anthropic-ai/sdk v0.104.0 changelog: first full Managed Agents support
  • Key execution endpoints:
    • POST /v1/sessions/{session_id}/events — send user messages / tool results
    • GET /v1/sessions/{session_id}/events/stream — SSE stream of inference events

Precedent in this repo

Comparable agentic execution surfaces are already instrumented for other providers:

  • Anthropic beta.messages.toolRunner — automated tool loop instrumented
  • Claude Agent SDK query() — agentic query instrumented
  • Google ADK Runner.runAsync, BaseAgent.runAsync — agentic execution instrumented
  • OpenAI Agents MultiTracingProcessor lifecycle hooks — instrumented

Local files inspected

  • js/src/auto-instrumentations/configs/anthropic.ts — 4 entries only; no sessions/agents entries
  • js/src/instrumentation/plugins/anthropic-channels.ts — 3 channels only; no managed agent channels
  • js/src/wrappers/anthropic.ts — no beta.agents / beta.sessions proxy handling
  • js/src/vendor-sdk-types/anthropic.ts — no managed agent type definitions
  • e2e/scenarios/anthropic-instrumentation/ — no managed agent test scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions