Skip to content

fix(spans): propagate gen_ai.conversation.id to execute_tool spans - #108

Merged
rgao-coreweave merged 2 commits into
mainfrom
fix/tool-span-conversation-id
Jul 17, 2026
Merged

fix(spans): propagate gen_ai.conversation.id to execute_tool spans#108
rgao-coreweave merged 2 commits into
mainfrom
fix/tool-span-conversation-id

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

startToolSpan was the only span builder not propagating gen_ai.conversation.id. Tool spans inherit it from their root turn span at query time, so if the root is lost to a hard crash (SIGKILL/OOM), already-exported tool spans can't be stitched to a conversation.

Propagates it directly onto execute_tool spans. Defense-in-depth alongside #107 (graceful-shutdown root fix), covering the hard-crash case.

Test: new test drives a real PreToolUse and asserts the tool span carries the conversation id.

@rgao-coreweave
rgao-coreweave force-pushed the fix/tool-span-conversation-id branch from f8e133d to 500f313 Compare July 17, 2026 00:25
@w-b-hivemind

w-b-hivemind Bot commented Jul 17, 2026

Copy link
Copy Markdown

HiveMind Sessions

2 sessions · 15m · $4.22

Session Agent Duration Tokens Cost Lines
Update Github Pull Request Description
9cd4dbb3-ed6e-4e73-ba94-62b1b5c6246d
claude 4m 13.9K $0.79 +1 -2
Review and Push PR #108
7c70e4b5-4a59-4746-8aff-10eebb958c79
claude 11m 45.3K $3.43 +69 -0
Total 15m 59.2K $4.22 +70 -2

View all sessions in HiveMind →

Run claude --resume 9cd4dbb3-ed6e-4e73-ba94-62b1b5c6246d to pickup where you left off.

startToolSpan was the only span builder not propagating gen_ai.conversation.id; tool spans inherited it from their root turn span at query time. If the root is lost to a hard crash (SIGKILL/OOM), the exported tool spans can't be stitched to a conversation. Propagate it directly so the tool span survives a lost root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rgao-coreweave rgao-coreweave changed the title fix(spans): stamp gen_ai.conversation.id on execute_tool spans fix(spans): propagate gen_ai.conversation.id to execute_tool spans Jul 17, 2026
@rgao-coreweave
rgao-coreweave force-pushed the fix/tool-span-conversation-id branch from 500f313 to 845dbdf Compare July 17, 2026 00:31
Comments duplicated the PR description verbatim; kept a one-line why.
@rgao-coreweave
rgao-coreweave marked this pull request as ready for review July 17, 2026 06:18
@rgao-coreweave
rgao-coreweave requested a review from a team as a code owner July 17, 2026 06:18

@drtangible drtangible left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

Comment thread tests/tool-span-conversation-id.test.ts
@rgao-coreweave
rgao-coreweave merged commit 3c56d16 into main Jul 17, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants