Skip to content

Follow-ups from the 2026-11-30 dependency bumps: new upstream surfaces to trace #1212

Backlog

Description

These came out of the research on the minor bumps in the 2026-11-30 weekly dependency update (#1205). None of them breaks anything or blocks that PR. Each is a gap in coverage for an upstream feature that's new or changed. Each fix needs to keep the older matrix pins working, so prefer feature detection. The two pins held back in #1205 are tracked separately in #1211.

openai 3.60

  • Trace Agents API spend controls. Upstream adds agent.session.budget_reached (openai/types/beta/agent_session_budget_reached_event.py, in the agent_session_event.py union), AgentSession.spend_control (limit, consumed, USD cents) and status "budget_reached", a spend_control request param on agents/session_create_params.py (and sessions.update), and turn error code session_budget_exceeded. _AgentSessionTrace.observe() in py/src/braintrust/integrations/openai/tracing.py ignores the event, _observe_session only runs on created/in_progress/idle, and _agent_session_params() drops spend_control. Fix: log session_status/spend_control metadata on the event, read getattr(session, "spend_control", None), and copy the request param. No gate needed. Needs a new latest-only cassette with a low limit.
  • Parse decisions.with_raw_response.create before logging. _decisions_create_wrapper / _log_decisions_response in py/src/braintrust/integrations/openai/tracing.py don't check _raw_response_requested(kwargs), so a LegacyAPIResponse is logged via vars() and the span loses answers and usage (upstream openai/resources/decisions.py, DecisionsWithRawResponse). Fix: .parse() when raw mode is requested, as the chat and responses wrappers do. Instructor 1.18's decisions mode calls this path. Needs a new cassette.

instructor 1.18

  • Trace Mode.DECISIONS. instructor.from_openai(..., mode=Mode.DECISIONS) (instructor/v2/providers/openai/client.py) and from_provider(..., mode=Mode.DECISIONS) (instructor/v2/auto_client.py) return instructor/decisions/client.py:DecisionsClient / AsyncDecisionsClient, not Instructor, so there is no instructor span (the from_provider path has no span at all). Fix: patch DecisionsClient.create / create_with_completion and the async versions (keyword-only response_model, context, input, strict), gated on instructor.decisions existing. Depends on the openai raw-response fix above. Needs a new latest-only cassette.
  • Not from this bump: _extract_response_model / _build_input in py/src/braintrust/integrations/instructor/tracing.py assume positional (response_model, messages), but create_iterable and create_with_completion take (messages, response_model), so positional calls to those log swapped fields.

litellm 1.111

  • Aggregate streamed audio deltas. Delta.audio is widened to ChatCompletionAudioDelta (litellm/types/utils.py) and Gemini now streams audio deltas (litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py). _postprocess_completion_streaming_results in py/src/braintrust/integrations/litellm/tracing.py only rebuilds role/content/tool_calls, so streamed audio is dropped. Fix: concatenate delta.audio.data/transcript and route through _extract_audio_output, using _get_field. Needs a new streamed Gemini audio cassette.
  • Log speech usage. HttpxBinaryResponseContent gains usage (litellm/types/llms/openai.py; set by the new Replicate TTS provider, and already by Vertex/Dashscope). _speech_wrapper / _aspeech_wrapper_async in py/src/braintrust/integrations/litellm/tracing.py never read it. Fix: metrics.update(_parse_metrics_from_usage(_get_field(resp, "usage"))). Needs a cassette from a provider that returns usage.
  • Optional: litellm.generate_content is newly exported at top level; it and agenerate_content are untraced (an existing gap).

pydantic-ai 2.77

  • Log the new compact= run argument. Added to AbstractAgent.run and friends (pydantic_ai/agent/abstract.py; used by compact_history()). _AGENT_INPUT_ALLOWLIST in py/src/braintrust/integrations/pydantic_ai/tracing.py doesn't list it. Fix: add "compact" (bool or {reason, focus}). No gate needed; an existing cassette can carry the assertion.
  • Trace native compaction model calls. The new capabilities/native_compaction.py (NativeCompaction, Anthropic and OpenAI Responses) calls Model.compact_messages (pydantic_ai/models/__init__.py). _wrap_concrete_model_class only wraps request, request_stream and prepare_request. Fix: wrap compact_messages with an LLM span, guarded by hasattr. Needs a new cassette.
  • Capture run compaction records. AgentRunResult.compactions / CompactionRecord (pydantic_ai/run.py, result.py) and the compaction_start/compaction_end events are ignored by _log_agent_result. Fix: log count and reasons as metadata via getattr. Comes with the cassette above.
  • Optional (pydantic-ai-harness 0.77): compact_if_smaller gained skip_on and emits a summary_failed skipped span (pydantic_ai_harness/compaction/_shared.py); skipped compactions are still not mirrored by the harness tracing (existing gap).

strands-agents 1.68

  • Record the provider for SageMakerDecisionModel. It stores config as _request_config (strands/decisions/sagemaker_decision_model.py), but _decision_model_metadata in py/src/braintrust/integrations/strands/tracing.py only reads _provider_config. Fix: in _log_decision_result, also log result.metadata.provider_name (already set to "sagemaker", field exists since 1.65) via getattr. A cassette needs a SageMaker endpoint, which may be impractical.
  • Optional: InvocationContext.usage_by_model (strands/agent/invocation_context.py) could be logged as a per-model usage breakdown.

livekit-agents 1.9 (lands with the held pin, see #1211)

  • Use the upstream speech_end_time for STT-driven end of speech. 1.9 passes speech_end_time to AgentActivity.on_end_of_speech (computed in livekit/agents/voice/audio_recognition.py). user_speech_end in py/src/braintrust/integrations/livekit_agents/tracing.py ends the span at time.time() when ev is None, which now drifts from LiveKit's own value. Fix: prefer the bound speech_end_time when it's a valid timestamp; keep the current calculation for 1.8.9–1.8.12. Needs a cassette with STT turn detection (can be recorded with the held-pin re-record).

cursor-sdk 1.5

  • Log RunResult.request_id. New in cursor_sdk/types.py; CursorRunTracker.finish in py/src/braintrust/integrations/cursor_sdk/tracing.py logs no run identifiers. Fix: add request_id (and possibly run/agent ids) to root span metadata via _value(result, "request_id"); None on older pins.
  • Watch when re-recording: cursor_sdk/_helpers.py now prefers GROK_BUILD_API_KEY over CURSOR_API_KEY; if it's set locally it wins over the fixture key.

Nothing needed

anthropic 2.14, mistralai 3.9 (prompt_tokens_details is now a typed model; already mapped to prompt_cached_tokens), autoevals 0.6, openai-agents 0.26 and temporalio 1.37: patch targets, signatures and serialized shapes checked, no gaps found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions