Skip to content

Preserve live Claude nested agent parentage - #305

Merged
Stephen Belanger (Qard) merged 1 commit into
mainfrom
fix/claude-live-nested-parentage
Nov 20, 2026
Merged

Stephen Belanger (Qard) merged 1 commit into
mainfrom
fix/claude-live-nested-parentage

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Live Claude Code traces can show a nested agent beside the agent that launched it, hiding who delegated the work. This keeps nested work under its originating agent, including concurrent launches.

Fixes #299

Verified before and after with a real Claude Code 2.1.326 nested-agent run using the debug sink. The regression covers concurrent launches and interrupted sessions. When a launch is ambiguous, the child span is held until native ancestry is available or the session ends; missing ancestry falls back to the turn. Delivery to Braintrust has not been verified. The locked all-features daemon suite and Clippy passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T19:13:06.509757Z 6b6955a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b6955a82c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment on lines +170 to +171
#[serde(default)]
deferred_insert: Option<SpanRow>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve deferred spans' turn ownership across recovery

If the daemon restarts after a nested SubagentStart but before its SubagentStop, restoring this deferred SpanRow loses its turn_span_id, because that field is marked #[serde(skip)] in translate/mod.rs. The row has not yet passed through TurnLineage, so its metadata does not contain the ownership either. When the deferred insert is eventually emitted, TurnLineage cannot stamp metadata.turn_span_id, leaving the subagent out of turn-filtered aggregations even though its descendants retain their ownership. Persist the owner separately or restore it from agent_origins before emitting the deferred row.

Useful? React with 👍 / 👎.

@Qard
Stephen Belanger (Qard) force-pushed the fix/claude-live-nested-parentage branch from 6b6955a to dfe65a8 Compare November 20, 2026 11:04
@Qard
Stephen Belanger (Qard) merged commit 2f1f99f into main Nov 20, 2026
50 of 53 checks passed
@Qard
Stephen Belanger (Qard) deleted the fix/claude-live-nested-parentage branch November 20, 2026 16:24
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.

Live Claude Code tracing puts nested sub-agents under the turn instead of the sub-agent that started them

2 participants