Skip to content

test: consolidate tracing suite (superseded by split stack) - #144

Draft
rgao-coreweave wants to merge 11 commits into
graphite-base/144from
109-16-consolidate-tests
Draft

test: consolidate tracing suite (superseded by split stack)#144
rgao-coreweave wants to merge 11 commits into
graphite-base/144from
109-16-consolidate-tests

Conversation

@rgao-coreweave

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

Copy link
Copy Markdown
Contributor

Status: superseded

This draft consolidated tests across the former monolithic tracing history. The rewritten stack keeps each regression beside the behavior it protects, so replaying this patch would make the review boundaries less clear.

Do not review or merge this PR. Its historical branch remains available for reference.

Replacement stack: #129#130#142#147#131#151#148#149#143.

@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 31ce1af to 480ef43 Compare July 21, 2026 00:29
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 649873b to abacfc7 Compare July 21, 2026 00:29
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 480ef43 to c1b4159 Compare July 21, 2026 04:39
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from abacfc7 to 0bc85ce Compare July 21, 2026 04:39
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from c1b4159 to 98bddd5 Compare July 21, 2026 05:34
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 0bc85ce to 69fe0dd Compare July 21, 2026 05:34
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 98bddd5 to 8a48bb7 Compare July 21, 2026 06:30
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch 2 times, most recently from 3aeffe1 to a3a67b2 Compare July 21, 2026 06:39
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch 2 times, most recently from 0faf31f to 075dd45 Compare July 21, 2026 17:07
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from a3a67b2 to 6f54b66 Compare July 21, 2026 17:07
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 075dd45 to 82db0d5 Compare July 22, 2026 04:23
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 6f54b66 to 390159b Compare July 22, 2026 04:23
Emit a chat span (LLM) per assistant API response and execute_tool
spans for tool calls, restoring the coverage parked by the turn-core
swap:

- advanceMainAgentChatSpan maps a PreToolUse tool_use_id to its
  response via the transcript and opens the response's chat span; tools
  nest under it. Split transcript lines sharing a message.id group into
  one span so usage is never double-counted.
- Stop finalizes the active chat span and emits spans for tool-less
  responses; an interrupted turn closes its chat span as superseded
  instead of crashing on a stale response key.
- PostToolUse[Failure] closes the pending tool span with its result
  (ERROR + error.type on failure); PermissionRequest stamps span
  events.

Agent dispatches still get a plain execute_tool span; the subagent
invoke_agent marker lands in the next PR of this stack.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 82db0d5 to ec32d0c Compare July 22, 2026 05:38
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 390159b to 832927e Compare July 22, 2026 05:38
Move ordinary Agent dispatch and SubagentStart/SubagentStop tracing into the chat/tool layer. Main-agent tools parent to the turn while subagent tools and chats parent to the SubAgent marker. Reconstruct chat siblings from transcripts at Stop or interrupted-turn finalization.
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 832927e to 907b379 Compare July 22, 2026 17:12
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from ec32d0c to 80eedb1 Compare July 22, 2026 17:12
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from 80eedb1 to d3a3f5c Compare July 22, 2026 17:26
rgao-coreweave and others added 7 commits July 22, 2026 11:26
Keep cross-session team correlation, TeammateIdle transcript emission, FIFO re-spawn handling, and team lifecycle guards in the team-specific layer. Ordinary subagent tracing now comes from the parent branch.
Pure deletion: the hand-rolled builders, baggage plumbing, and their
builder-only ATTR/OP keys became unreferenced in the SDK swap. Drop the
now-unused exporter/provider packages; sdk-trace-base moves to devDeps
for the tests' in-memory exporter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude Code splits one response's blocks across transcript lines sharing
a message.id; buildTurn now folds them (last line's usage/timestamp — it
accompanies stop_reason — first line's prevTimestamp), so consumers see
one call per response. The daemon's response-grouping layer collapses to
direct lookups and chatSpans.ts goes away, its three survivors inlined
as module helpers in daemon.ts, their only consumer. Type-guards
(readTranscriptLine) replace the parser's remaining as-casts; dead
totalUsage() deleted.

Also a comment pass across the touched files: doc blocks cut to the
load-bearing why.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An Agent dispatch from WITHIN a subagent (agent_id set) fell through to
the generic tool branch: no tracker, so its SubagentStart became an
orphan flattened under the turn with one ERROR log per spawn (the bug
predates the SDK swap; reproduced live by a recursive depth test).
Parent the marker under the spawning subagent's own marker instead, so
recursive spawns keep their depth; prompt-hash correlation and
PostToolUse settling work unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 test files fold into 8 (chat-spans, turn-spans, subagents,
daemon-lifecycle, config, install, plus status and stale-daemon-socket
untouched). Every test case and assertion carries over verbatim;
identical local fixtures/builders dedupe to one copy per file, and
anecdotal comments in the merged files are trimmed. 85 tests,
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rgao-coreweave
rgao-coreweave force-pushed the 109-16-consolidate-tests branch from d3a3f5c to ee9e8fc Compare July 22, 2026 18:54
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch 2 times, most recently from 41dc9b0 to 044fb26 Compare July 22, 2026 23:45
@rgao-coreweave rgao-coreweave changed the title test: consolidate the suite into per-concern files test: consolidate tracing suite (superseded by split stack) Jul 22, 2026
@rgao-coreweave
rgao-coreweave force-pushed the 109-10-recursive-dispatch branch from 044fb26 to b3cc46a Compare July 23, 2026 01:43
@rgao-coreweave
rgao-coreweave changed the base branch from 109-10-recursive-dispatch to graphite-base/144 July 23, 2026 01:44
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