feat(daemon): emit GenAI spans via the weave SDK - #128
Merged
Conversation
This was referenced Jul 17, 2026
Contributor
Author
This was referenced Jul 17, 2026
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 17, 2026 18:18
440b9b2 to
951627f
Compare
rgao-coreweave
force-pushed
the
109-06-session-types
branch
from
July 17, 2026 18:18
40c30a9 to
8747b24
Compare
rgao-coreweave
changed the base branch from
109-06-session-types
to
graphite-base/128
July 17, 2026 20:18
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 17, 2026 20:18
951627f to
6a8a7f6
Compare
rgao-coreweave
force-pushed
the
graphite-base/128
branch
from
July 17, 2026 20:18
8747b24 to
3d6ce49
Compare
rgao-coreweave
changed the base branch from
graphite-base/128
to
109-05-session-helpers
July 17, 2026 20:18
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 17, 2026 20:34
6a8a7f6 to
43e66c8
Compare
rgao-coreweave
force-pushed
the
109-05-session-helpers
branch
2 times, most recently
from
July 17, 2026 20:39
3587734 to
2d19b88
Compare
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 17, 2026 20:39
43e66c8 to
2458020
Compare
rgao-coreweave
changed the base branch from
109-05-session-helpers
to
graphite-base/128
July 17, 2026 20:47
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 18, 2026 00:04
2458020 to
a4a07b4
Compare
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 18, 2026 00:06
a4a07b4 to
a223d6e
Compare
HiveMind Sessions4 sessions · 1h 23m · $110
View all sessions in HiveMind → Run |
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
4 times, most recently
from
July 18, 2026 07:10
9e23361 to
4e70e9a
Compare
rgao-coreweave
changed the base branch from
109-07a-genai-helpers
to
graphite-base/128
July 19, 2026 22:35
rgao-coreweave
force-pushed
the
graphite-base/128
branch
from
July 19, 2026 22:35
aff47b6 to
cee8265
Compare
rgao-coreweave
changed the base branch from
graphite-base/128
to
109-13-genai-helpers
July 19, 2026 22:37
This was referenced Jul 19, 2026
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 21, 2026 00:29
bd44666 to
c11afa2
Compare
rgao-coreweave
force-pushed
the
109-13-genai-helpers
branch
from
July 21, 2026 00:29
aff47b6 to
28f1c2a
Compare
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
3 times, most recently
from
July 21, 2026 06:30
b6e8465 to
99329a6
Compare
rgao-coreweave
marked this pull request as ready for review
July 21, 2026 06:32
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 21, 2026 06:39
99329a6 to
60f41d6
Compare
rgao-coreweave
force-pushed
the
109-13-genai-helpers
branch
from
July 21, 2026 22:44
015c3ab to
54aa425
Compare
Swap the daemon's conversation/turn core onto the weave SDK genai primitives: - weave.init() replaces the hand-rolled tracer provider/OTLP exporter wiring; OTel diag warnings/errors land in the daemon log (exporter failures were silent). - One Conversation handle per session (sessionState starts it) seeds gen_ai.conversation.id, agent identity, and the integration attributes onto every span through the handle chain, so there is no ambient per-event state. runIsolated per event keeps the SDK's single-active guards clear of concurrent sessions. - Turns via conversation.startTurn: turn input rides TurnInit.userMessage, instruction files ride TurnInit.systemInstructions. Turns that end without a Stop hook (user interrupt) close as superseded_by_next_prompt instead of leaking the root span. - sessionState moves wholesale to weave-handle types; the tracker/team fields it declares are consumed by the subagent PR later in this stack. Chat (per-response LLM), tool, and subagent span emission is parked: the handlers count tool calls for the turn attrs and log, and their tests leave with them; both return rewritten in the next PRs of this stack. The plugin is not fully functional until the stack lands; each PR builds green (npm run check). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The turn's ordinal (weave.claude_code.turn.number) is derivable from the conversation's ordered turns server-side; stop setting it on the span. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
weave.claude_code.plugin.version is session-level, so set it once on the Conversation; it propagates to every turn and child span like the other integration attributes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 22, 2026 03:09
deea89c to
55fceee
Compare
rgao-coreweave
force-pushed
the
109-07-sdk-core
branch
from
July 22, 2026 04:03
3c55c50 to
0b3bea6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Swap the daemon's conversation/turn core onto the weave SDK genai primitives.
weave.init()replaces the hand-rolled tracer/OTLP exporter wiring; OTel diag warnings/errors land in the daemon log (they were silent).Conversationhandle per session seedsconversation.id, agent identity, and the integration attributes through the handle chain, so there is no ambient per-event state;runIsolatedper event keeps the SDK's single-active guards clear of concurrent sessions.startTurn; turn input ridesTurnInit.userMessage, instruction files rideTurnInit.systemInstructions. A turn interrupted without a Stop hook closes assuperseded_by_next_promptinstead of leaking the root span.sessionStatemoves to weave-handle types; its tracker/team fields are consumed in feat(trace): trace explicit Agent Team lifecycles #143.Chat/tool/subagent emission is parked (handlers count tool calls and log) and lands in #142/#143 with its tests. Each PR builds green; the plugin is fully functional at #143.
Stack: #141 → this PR → #142 → #143 → #129 → #130 → #131 → #144 → #145
npm run checkgreen (61 tests).