Skip to content

feat(daemon): add weave-SDK genai helper layer - #141

Merged
rgao-coreweave merged 1 commit into
mainfrom
109-13-genai-helpers
Jul 21, 2026
Merged

feat(daemon): add weave-SDK genai helper layer#141
rgao-coreweave merged 1 commit into
mainfrom
109-13-genai-helpers

Conversation

@rgao-coreweave

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

Copy link
Copy Markdown
Contributor

Groundwork for swapping the daemon's hand-rolled span builders for the weave SDK genai primitives (next PRs in this stack): pure helpers typed against the SDK, consumed by nothing yet.

  • chatSpans.ts (new): response-key grouping and chat-span open/record helpers.
  • genaiSpans.ts: buildIntegrationAttrs, contentBlocksToParts, buildUsage, assistantOutputMessages; existing formatting helpers move into the kept section; the remaining builders are marked LEGACY (still used by daemon.ts until the swap lands).
  • parser.ts: isToolUseBlock type guard.
  • interleaved-assistant-spans.test.ts becomes a contentBlocksToParts unit test.

Old exporter and daemon behavior untouched. npm run check green (86 tests).

@w-b-hivemind

w-b-hivemind Bot commented Jul 21, 2026

Copy link
Copy Markdown

HiveMind Sessions

1 session · 47m · $48

Session Agent Duration Tokens Cost Lines
Replace 'Stamped' With 'Propagated' in PR
9c63add0-5ef7-48e6-97e7-3b41bf8d962e
claude 47m 163.0K $48 +155 -410
Total 47m 163.0K $48 +155 -410

View all sessions in HiveMind →

Run claude --resume 9c63add0-5ef7-48e6-97e7-3b41bf8d962e to pickup where you left off.

Groundwork for swapping the daemon's hand-rolled span builders for the
weave SDK genai primitives (next PRs in this stack): pure helpers typed
against the SDK, consumed by nothing yet.

- chatSpans.ts: response-key grouping (chatMessageKey,
  callsForResponseKey, findToolUseResponseKey) and chat-span
  open/record helpers (openChatForGroup, recordChat).
- genaiSpans.ts: buildIntegrationAttrs, contentBlocksToParts,
  buildUsage, assistantOutputMessages; providerFromModel / jsonStr /
  parseTimestamp / snippet / toolDisplayName move into the kept helper
  section; the remaining builders are marked LEGACY (still used by
  daemon.ts until the swap lands).
- parser.ts: isToolUseBlock type guard.
- interleaved-assistant-spans.test.ts becomes a contentBlocksToParts
  unit test (its old child-span coverage returns rewritten with the
  swap).

The old exporter and daemon behavior are untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rgao-coreweave
rgao-coreweave marked this pull request as ready for review July 21, 2026 06:27
@rgao-coreweave
rgao-coreweave requested a review from a team as a code owner July 21, 2026 06:27

@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.

👍 👍 👍

@rgao-coreweave
rgao-coreweave merged commit 54aa425 into main Jul 21, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 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.

2 participants