[Bug] Top-level forked sessions are nested as subagents in Agents View #1635
goghcrow
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
A saved top-level session fork can retain
parentSessionPathwhile explicitly persistingrlmDepth: 0. Agents View currently classifies every saved session withparentSessionPathas a subagent, so top-level forks are nested behind expandable subagent rows instead of appearing as independent sessions.Reproduction
--resume.The forked session header has both:
{ "parentSession": "/path/to/source-session.jsonl", "rlmDepth": 0 }Actual behavior
The saved fork is rendered as a subagent of its source session and may be hidden behind one or more collapsed
subagentsrows.Expected behavior
rlmDepth > 0: render as a subagent.rlmDepth === 0: render as a top-level session, regardless ofparentSessionPath.rlmDepth: preserve the existingparentSessionPathfallback for legacy saved sessions.Source-level cause
On current
main,summaryForUnifiedRecord()derives saved-sessionruntimeKindfromparentSessionPathalone:This conflates fork provenance with RLM hierarchy even though
readSessionInfo()already resolves and returnsrlmDepth.Proposed minimal fix
Use explicit depth when present and retain the current fallback only for legacy records:
No session migration, daemon protocol change, new state, or compatibility layer is required.
Validation
I added a regression to the existing
agents-view-state.test.tssuite covering both boundaries:parentSessionPathandrlmDepth: 0remains a top-level row;rlmDepthremains a subagent.Local results:
agents-view-state.test.ts: 66/66 passednpm run check: passedA focused implementation is available in the automatically closed PR #1634. If this behavior and fix direction are accepted, please invite or vouch the contribution so I can reopen or resubmit it according to
CONTRIBUTING.md.All reactions