Commit d482b6d
fix: link Claude subagent tool calls (#459)
## Summary
- Link Claude `Task` / `Agent` tool calls to child subagent sessions
using result-side `toolUseResult.agentId` when
queue/progress mapping is absent.
- Preserve sibling Claude subagent tool calls when Claude emits additive
same-`message.id` assistant chunks.
- Keep streaming snapshot behavior by replacing progressive partial text
with the latest text block while still
preserving distinct additive content blocks.
## Context
This is the Claude-side version of the inline subagent-linking contract
addressed for Codex in #444 / #458.
The UI already renders inline subagent sessions when
`tool_calls.subagent_session_id` is populated. This PR makes
Claude ingestion populate that existing field in more cases, so child
sessions that are already ingested can appear
inline under the exact parent `Task` / `Agent` tool call that launched
them.
## Backfill note
This changes parsed tool-call metadata for existing Claude rows.
Existing archives will need a full parser
reprocess / data-version bump to backfill inline links.
This PR intentionally does not bump `dataVersion`; maintainers should
decide whether to trigger that reparse.
## Validation
- `go test ./internal/parser ./internal/sync -count=1`
- `git diff --check origin/main...HEAD`
If you add screenshots later, I’d add a final section:
## Visual Check
- Before: Claude rendered the three sibling `Task` calls, but none had
an inline linked subagent session. <img width="960" height="463"
alt="image"
src="https://github.com/user-attachments/assets/f0b0417e-476f-4763-ba43-dc49e469e4c9"
/>
- After: The same three sibling `Task` calls are preserved. <img
width="959" height="514" alt="image"
src="https://github.com/user-attachments/assets/f5c15e57-6737-41a0-8e33-71d3c610d10a"
/>
---------
Co-authored-by: Wes McKinney <wesmckinn+git@gmail.com>1 parent a9dd6d5 commit d482b6d
8 files changed
Lines changed: 1085 additions & 42 deletions
File tree
- internal
- db
- parser
- sync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
31 | 40 | | |
32 | 41 | | |
33 | | - | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
| |||
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
71 | | - | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
439 | 462 | | |
440 | 463 | | |
441 | 464 | | |
| |||
0 commit comments