Skip to content

Replace deprecated gen_ai.response.tool_calls with gen_ai.output.messages #22839

Description

@nicohrubec

@sentry/conventions deprecates gen_ai.response.tool_calls in favor of gen_ai.output.messages. gen_ai.response.tool_calls holds a stringified array of tool-call objects; gen_ai.output.messages expects a stringified array of structured message objects ([{role, parts: [...], finish_reason}]), which unifies response text and tool calls into a single message.

Entails building the structured message format from the tool calls and emitting it under the new attribute. Affects all AI integrations (OpenAI, Anthropic, Google GenAI, LangChain, LangGraph, Workers AI, and the shared streaming path). Should be done together with the gen_ai.response.text replacement, since both merge into the same gen_ai.output.messages attribute.

We can likely postpone this until after the major, if we do it at all, since there are still discussions about handling this in Relay.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions