Skip to content

feat: add user_handle and topic tags to root agent spans#303

Merged
Kyle-Verhoog merged 2 commits intomasterfrom
kyle/agent-span-tagging
Mar 16, 2026
Merged

feat: add user_handle and topic tags to root agent spans#303
Kyle-Verhoog merged 2 commits intomasterfrom
kyle/agent-span-tagging

Conversation

@Kyle-Verhoog
Copy link
Member

@Kyle-Verhoog Kyle-Verhoog commented Mar 16, 2026

Summary

  • Add DD_USER_HANDLE env var support — tags root agent spans with user_handle:<handle>
  • Persist conversation topic across turns so subsequent interactions on the same topic reuse the haiku-detected title
  • Tag root spans with topic:<title> (eagerly on preliminary span, updated on Stop if haiku detects a change)
  • Span name is now always claude-code-request instead of using the topic

Test plan

  • All existing tests pass
  • Verified user_handle tag appears on root spans when env var is set
  • Verified topic tag persists across turns

Claude session: 290749d0-c759-42b7-8d1b-d4edb76c65d3
Resume: claude --resume 290749d0-c759-42b7-8d1b-d4edb76c65d3

🤖 Generated with Claude Code

@Kyle-Verhoog Kyle-Verhoog force-pushed the kyle/agent-span-tagging branch from f5765a8 to 7817712 Compare March 16, 2026 13:26
Kyle-Verhoog and others added 2 commits March 16, 2026 09:36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Persist conversation_title across turns so subsequent interactions on
the same topic reuse the haiku-detected title. Tag it as topic:<title>
on root agent spans (eagerly on the preliminary span, updated on Stop
if haiku detects a topic change). The span name is now always
"claude-code-request" instead of using the topic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kyle-Verhoog Kyle-Verhoog force-pushed the kyle/agent-span-tagging branch from 7817712 to 589cb45 Compare March 16, 2026 13:40
@Kyle-Verhoog Kyle-Verhoog changed the title feat: add user.email and topic tags to root agent spans feat: add user_handle and topic tags to root agent spans Mar 16, 2026
@Kyle-Verhoog Kyle-Verhoog added the no-releasenote This PR does not require a releasenote entry label Mar 16, 2026
@Kyle-Verhoog Kyle-Verhoog merged commit b67aed5 into master Mar 16, 2026
18 of 19 checks passed
@Kyle-Verhoog Kyle-Verhoog deleted the kyle/agent-span-tagging branch March 16, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-releasenote This PR does not require a releasenote entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants