Skip to content

sessions: feat: show independent sessions beneath their creators - #336447

Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
ulugbekna/nested-session-tree-statefrom
ulugbekna/nested-session-hierarchy
Draft

Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
ulugbekna/nested-session-tree-statefrom
ulugbekna/nested-session-hierarchy

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Display independently managed, agent-created sessions recursively beneath their creator in the Agents Window, including children working in different repositories. Extend the existing WorkbenchObjectTree rather than introducing a second tree implementation.

This draft is part 3 of 4, based on #336446. The existing nested chat rows are conversations within one session; the new rows are full sessions with their own workspace, execution state, capabilities, and actions. The provider-neutral createdBySession reference already exists, so this PR does not add an AHP parent field or a new session-creation tool.

Visual example

A parent session in alpha, its child in beta, and a grandchild back in alpha

Earlier live Code OSS capture using disposable test repositories. It illustrates the actual hierarchy and each session's repository label, not a new live-UI run on this rebased commit. Unrelated window content was excluded from the crop.

Placement and ownership

  • Resolve creator references using URI identity and build a full-session forest before workspace/date grouping. Assign each branch to its root's section, while preserving each descendant's own repository. Section roots remain distinct from full membership, so descendants are counted once and do not gain duplicate primary workspace entries.
  • Nest only when both sessions are unarchived, unpinned, non-quick-chat sessions with matching rendered custom-group placement. Preserve existing pin/group priorities and saved membership; do not migrate them to force nesting.
  • Re-root a child when its creator is missing, filtered out, or incompatible. Remove malformed cycle edges so every session stays reachable. Recompute when creator metadata and other structural inputs arrive or change.
  • Keep lifecycle ownership independent: archiving, deleting, stopping, or opening a parent does not implicitly perform the same operation on its children. Flat-list consumers remain flat.

Tree interaction and rendering

Compose existing peer chats before recursively composed full-session children. Apply presentation caps to root branches, map descendant reveal requests to those roots, and keep native expansion, selection, keyboard navigation, and tree levels aligned with the actual structure.

Render depth-aware guides in normal, compact, and phone layouts. Reuse the ancestor list for body indentation, reset recycled root rows to depth zero, and keep guide emphasis tied to hover/focus/selection. A child retains its own repository hint while running or awaiting input; accessible labels identify its creator and repository rather than implying it works in the section root's repository.

Observe semantic creator URI changes and other structural inputs, coalescing synchronous updates and replacing observer stores when the catalog refreshes.

Deliberate boundaries

This PR keeps drag-and-drop conservative: ordinary root reorder remains available, but nested-session reordering waits for the following draft. Creator-linked group moves use membership-only feedback instead of promising an unsupported before/after position.

There is no independent-child activity roll-up on a collapsed parent. A completed parent can still contain a hidden working or input-blocked child; users expand the branch, search, or navigate directly to that session. This is separate from existing status aggregation within a session's own chats. No cross-host scheduler, automatic cloning, reparenting API, or implicit agent coordination is added.

Coverage and review

Regression cases cover cross-repository descendants mixed with peer chats, root-date placement, pin/group boundaries, missing and late creators, cycles, collapse/reveal/search through multiple levels, root caps, row recycling, guide endings, independent actions, and compact repository hints. Normal and narrow themed fixtures render the real SessionsList.

After the review fix and restack, the complete stack's 228 focused tests and client typecheck pass on Electron 43.6.0. Earlier live Code OSS checks used local Copilot and disposable repositories to exercise independent status, questions/approvals, archive/restore, pin/group placement, reload, and search. Those live checks are not a new run on this rebased commit and do not claim remote/provider-wide coverage.

For manual review, use the existing agent-created-session flow to create a child in another repository on the same host, then inspect the expanded branch, the child's repository/status and actions, collapse/reload, search, and pin/group placement.

Stack

Part 3 of 4. Base: #336446. All PRs are drafts; review and merge bottom-up. Original commit labels are retained below; PR 1 also contains its test-only review follow-up.

Order PR Original commits Scope
1 #336444 1 + regression-test follow-up Repository action boundaries
2 #336446 2-4 Session state, Find, and reveal
3 #336447 5 Independent-session hierarchy
4 #336448 6 Nested session drag-and-drop

Nest independent sessions beneath their creator across repositories while preserving placement boundaries, lifecycle ownership, filtering, navigation, and peer-chat rows. Add hierarchy rendering, accessibility, component fixtures, and nested-session regressions.

Keep drag-and-drop conservative: reorder roots only and offer membership-only placement for creator-linked group moves.

Co-authored-by: Copilot App <[email protected]>
@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/nested-session-hierarchy branch from f08f0e2 to 203821a Compare September 16, 2026 18:22
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.

1 participant