[Bug] Session graph view assigns all nested Claude Code subagents to the top-level session as parent (#72) - #86
Open
jan21deepak wants to merge 1 commit into
Conversation
The Claude native forwarder always registered Task-tool subagents against the top-level session and only scanned the root subagents/ directory. Nested subagents therefore appeared as direct children of the main session in the web graph (and Agents list), flattening the true spawn chain. Walk nested subagents/ directories, resolve each spawn's toolUseId against the owning transcript, and persist each row's jsonl path so tail/cost forwarding follow nested files after restart. Co-authored-by: jan21deepak <jan21deepak@users.noreply.github.com>
Owner
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e021d41. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened automatically by Cursor Forge as a same-repo PR on
jan21deepak/omnigentafter the Cloud Agent pushed
cursor/fix-nested-subagent-graph-parent-bead(not against an upstream parent).Fixes #72.
Cursor agent:
bc-7e125cff-51c9-48b2-a141-a1d91985beadNote
Medium Risk
Changes sub-agent registration, parent resolution, and durable forwarder state in the Claude bridge path; mistakes could mis-parent sessions or skip nested agents, but behavior is covered by new integration tests and preserves legacy jsonl fallbacks.
Overview
Fixes the session graph showing every nested Claude Code sub-agent under the top-level session by teaching the native forwarder to walk the on-disk sub-agent tree and attach each
external_subagent_startto the session that actually issued the spawn.Registration no longer only scans the root
subagents/folder with a single parent id. New helpers discover…/agent-<parent>/subagents/directories, map each meta file’stoolUseIdto the owning conversation viaAgent/Tasktool_useids in the root and sub-agent transcripts, and retry registration in passes when a sibling must register first.SubagentEntrynow persistsjsonl_pathso tailing and cost aggregation use the rightagent-<id>.jsonlafter restart (legacy rows still fall back to the rootsubagents/layout).Tests cover spawn parent mapping for nested agents and assert nested starts POST to the parent child session’s events path, not the root.
Reviewed by Cursor Bugbot for commit e021d41. Bugbot is set up for automated code reviews on this repo. Configure here.