Skip to content

bug(sessions): reloading a live child while its parent is closed drops the child's parent pointer for good #1379

Description

@Juliusolsson05

Problem

If a LIVE child is reloaded or replaced while its parent pane is CLOSED (on the undo stack), the child loses its parent pointer for good. remapSessionsRelationships (session.ts replace and Reload Agents commits) drops any linkedParentId / orchestrationParentId / orchestrationRootId whose target is in neither the idMap nor the record's own session ids, and a closed parent is in neither. When the parent is later restored with Undo Close, #1374 remaps only pointers that still name it, and this child's pointer is already gone. Both panes are live but permanently unlinked: the child renders top-level, and the restored parent cannot see, prompt or close it through orchestration.

Evidence

Likely fix

On the replace/reload commits, keep a pointer whose target is still on the undo stack, rather than dropping everything that is not live. That needs the undo stack's closed ids at the commit.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    class:C2-identityIdentity/ownership across reload, replace, restore, wakesev:P3Minortype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions