Skip to content

Render the full orchestration subtree in shared-session viewers - #14857

Draft
danielpeng2 wants to merge 1 commit into
daniel/orch-subtree-ownerfrom
daniel/orch-subtree-viewer
Draft

Render the full orchestration subtree in shared-session viewers#14857
danielpeng2 wants to merge 1 commit into
daniel/orch-subtree-ownerfrom
daniel/orch-subtree-viewer

Conversation

@danielpeng2

@danielpeng2 danielpeng2 commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #14856 (owner-side subtree adoption; server half: warpdotdev/warp-server#14159).

A shared-session viewer of a tree-root orchestrator only rendered the root's direct children: the viewer SSE, its replay, and the cold-start REST seed were all ancestor-scoped, and every discovered run was hard-attributed to the stream anchor. Grandchildren spawned by remote children never appeared in the viewer's pill bar.

With MultiLevelOrchestration enabled:

  • Scope resolution: the viewer streamer determines during the cold-start seed whether the anchor is a tree root (its task has no parent_run_id). Root anchors seed via the root_run_id list filter and stream via subtree_root_run_id; mid-tree anchors — and any anchor whose root-ness can't be determined — keep the existing direct-children ancestor scope, so both stream shapes remain in the viewer path.
  • Event generalization: ChildSpawned/ChildStatusChanged now carry the wire event's actual parent_run_id alongside the stream-anchor id, instead of implying every run is a direct child of the anchor. The drain loop also skips the anchor's own events, which subtree streams inherently include.
  • Nested placement: the viewer model attaches each discovered run under its actual parent's placeholder (resolved from the fetched task metadata, with the event-carried parent as a fallback hint), parking rows that arrive before their parent and draining them once the parent's placeholder registers — mirroring the owner-side placement semantics from Adopt root-scoped subtree event streams for orchestration tree roots #14856. Direct children of the anchor behave exactly as before, as does everything when the flag is off or the server is old (parent_run_id absent ⇒ legacy anchor attribution).

Viewer cursor semantics are intentionally unchanged (the viewer-mode seed still merges descendant cursors; it only surfaces lifecycle state and the seed carries current statuses).

Linked Issue

Part of the remote nested-orchestration visibility work; no standalone GitHub issue.

Testing

  • New streamer tests: subtree-scope seed recording/descendant tracking, and drain behavior on subtree streams (anchor-event skipping, cursor advancement, parent_run_id propagation on emissions).
  • New viewer-model tests: grandchild placement under its actual parent's placeholder, and park-until-parent-registers drain ordering.
  • Updated existing streamer/viewer tests for the widened seed signature and event payloads; 117 tests in the two touched modules pass.
  • ./script/format and all three presubmit clippy invocations pass.
  • I have manually tested my changes locally with ./script/run

End-to-end validation (viewer of a root seeing a remote-remote grandchild live) is planned together with #14856 against a locally built warp-server from the PR S branch.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Co-Authored-By: Warp Agent agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Aug 9, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Follows the owner-side subtree adoption: a shared-session viewer of a
tree-root orchestrator previously only rendered the root's direct
children, because its stream, replay, and cold-start seed were all
ancestor-scoped. With MultiLevelOrchestration enabled:

- The viewer streamer resolves the anchor's root-ness during the
  cold-start seed (a root task has no parent_run_id). Root anchors seed
  via the root_run_id list filter and stream via subtree_root_run_id;
  mid-tree anchors — and anchors whose root-ness can't be determined —
  keep the existing direct-children ancestor scope.
- The drain loop skips the anchor's own events (subtree streams include
  the root) and ChildSpawned/ChildStatusChanged now carry the wire
  event's actual parent_run_id instead of hard-attributing every run to
  the stream anchor.
- The viewer model attaches descendants under their actual parent's
  placeholder (falling back to the event-carried parent when task
  metadata lacks one), parking out-of-dependency-order rows until the
  parent's placeholder registers. Viewer cursor semantics are unchanged.

Co-Authored-By: Warp Agent <agent@warp.dev>
@danielpeng2
danielpeng2 force-pushed the daniel/orch-subtree-viewer branch from 3625739 to 2ef0460 Compare August 9, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant