Skip to content

fix: rename to gen_ai.input.messages / gen_ai.output.messages (0.2.9)#21

Merged
Joshkop merged 1 commit into
mainfrom
fix/conversations-chat-input-messages
May 21, 2026
Merged

fix: rename to gen_ai.input.messages / gen_ai.output.messages (0.2.9)#21
Joshkop merged 1 commit into
mainfrom
fix/conversations-chat-input-messages

Conversation

@Joshkop
Copy link
Copy Markdown
Owner

@Joshkop Joshkop commented May 21, 2026

Summary

  • Renames gen_ai.request.messagesgen_ai.input.messages and gen_ai.response.textgen_ai.output.messages to match the current OTel gen_ai semantic convention that @sentry/node 10.53.x follows.
  • Wraps the assistant response as [{role: "assistant", content: response}] so the value shape matches what the SDK expects for output messages.
  • Same rename applied to the subagent invoke_agent span (src/subagent.ts).
  • Version bumped to 0.2.9 in package.json, .claude-plugin/plugin.json, .claude-plugin/marketplace.json.

Why

0.2.8 mirrored the prompt onto the chat child as gen_ai.request.messages, but the Sentry SDK silently dropped the legacy keys and initialized gen_ai.input.messages to []. Confirmed by inspecting a live span — gen_ai.input.messages: [] with no gen_ai.request.messages present. AI Conversations reads the new key and treats [] as "no conversation", so the view stayed empty.

Test plan

  • pnpm build clean
  • pnpm test — 424/424 pass
  • After merge + /plugin update: send a turn, confirm the chat span shows gen_ai.input.messages and gen_ai.output.messages populated in Sentry, AI Conversations view populates for the session.

🤖 Generated with Claude Code

Sentry JS SDK 10.53.x follows the current OTel gen_ai semantic convention,
which renamed gen_ai.request.messages -> gen_ai.input.messages and
gen_ai.response.text -> gen_ai.output.messages. The SDK silently dropped
our legacy keys and initialized gen_ai.input.messages to an empty array
on the chat span, so Sentry's AI Conversations view treated every turn
as "no input -> no conversation" and stayed empty even though all the
sibling attributes (agent.name, conversation.id, provider, model, etc.)
were correct.

- src/spans.ts: rename on both invoke_agent (agent) and chat (child)
  spans; output is now serialized as [{role:"assistant", content:response}]
  to match the array shape the SDK expects.
- src/subagent.ts: same rename on the synthesized subagent invoke_agent.
- tests/spans.test.ts: updated 6 assertions to the new attribute names.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Joshkop Joshkop force-pushed the fix/conversations-chat-input-messages branch from e3881e1 to ee4ddcf Compare May 21, 2026 11:07
@Joshkop Joshkop merged commit adfb3fa into main May 21, 2026
1 check passed
@Joshkop Joshkop deleted the fix/conversations-chat-input-messages branch May 21, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant