Repository navigation
Capture late Claude subagent model calls - #304
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed26961972
ℹ️ 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".
| "TranscriptUpdate" if event.payload.get("agent_transcript_path").is_some() => { | ||
| if let (Some(agent_id), Some(path)) = ( | ||
| string_field(&event.payload, "agent_id"), | ||
| string_field(&event.payload, "agent_transcript_path"), | ||
| ) { |
There was a problem hiding this comment.
Preserve the internal-agent filter for transcript updates
When an internal Claude agent (such as prompt suggestions) appends transcript records after its unpaired, empty-type SubagentStop, remember_claude_transcripts now registers it for polling, and this branch emits its model calls unconditionally. This bypasses the deliberate filter in handle that ignores these stops, covered by claude_ignores_untracked_empty_type_subagent_stops. The resulting LLM spans include unwanted internal activity and reference a subagent parent that was never created. Retain eligibility information for accepted delegated agents and apply it to child transcript updates as well.
Useful? React with 👍 / 👎.
Live Claude Code traces can omit a sub-agent’s final model call and its token usage. This captures calls written after the sub-agent stops, including when the daemon restarts before it observes them.
Fixes #300
Verified with a real Claude Code 2.1.326 background-agent session: the baseline trace contained one of two calls for each agent, while the updated trace contained both. Deterministic tests cover a late append, session end, restart and duplicate prevention. Verification used the debug sink; delivery to Braintrust has not been verified. The locked all-features daemon suite and Clippy passed.