Skip to content

QUALITY-928: push-based child discovery + orchestration polling removal (client)#13253

Draft
cephalonaut wants to merge 4 commits into
masterfrom
matthew/child-agent-started-events
Draft

QUALITY-928: push-based child discovery + orchestration polling removal (client)#13253
cephalonaut wants to merge 4 commits into
masterfrom
matthew/child-agent-started-events

Conversation

@cephalonaut

Copy link
Copy Markdown
Contributor

Description

Client side of QUALITY-928 — push-based child-agent discovery + orchestration polling removal. Follow-up to QUALITY-919 (#13208). Tech spec: specs/QUALITY-928/TECH.md (included in this PR).

Part 1 — remove fully-rolled-out flags + legacy polling (no behavior change):

  • Removed the OrchestrationViewerStreamer and OwnerOrchestrationAncestorStreamer feature flags (both already in the default cargo set, i.e. on for all channels).
  • Deleted the legacy OrchestrationViewerModel REST polling path (fetch_children/schedule_next_poll/maybe_kick_polling/apply_children_fetch, interval consts, polling fields). The SSE streamer-driven viewer path is now the only path.
  • Simplified desired_sse_filter so a parent always uses the AncestorRunId { include_self: true } stream; removed the now-dead UnsupportedRunIdCount variant + MAX_RUN_ID_STREAM_FILTER.

Part 2 — push-based discovery via child_agent_started:

  • Consume the new server child_agent_started event (ref_id = child run id) and register the child on the owner side.
  • A non-child root opens the owner-side AncestorRunId { include_self: true } stream on its first wait_for_events, replacing the per-wait get_ambient_agent_task fetch from QUALITY-919: register orchestrators for child events on wait_for_events #13208. Opening the ancestor (superset) stream directly avoids a cursor-handoff gap that a self→ancestor upgrade would introduce (see the spec's Risks).
  • Removed the viewer session_id poll timer in favor of an event-driven metadata fetch.
  • Reuses the existing WaitForEventsParentRegistration dogfood flag (no new flag); flag-off restores pre-QUALITY-919: register orchestrators for child events on wait_for_events #13208 behavior.

Depends on the warp-server PR (the child_agent_started emit) for end-to-end behavior; the client tolerates its absence.

Testing

  • Added unit tests in orchestration_event_streamer_tests.rs: ancestor-stream-at-first-wait, child registration without reconnect, idempotency, flag-off no-op, child/remote-view exclusions, unknown-event-ignored-advances-cursor; plus rewritten viewer fixtures.
  • cargo nextest run -p warp: 5404 passed, 0 failed. ./script/format and cargo clippy (presubmit versions) clean.
  • Manual e2e (dogfood, flag on): out-of-band child surfaces to the parent without the old 5s poll latency — pending.

Agent Mode

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

Conversation: https://staging.warp.dev/conversation/b0596521-fc34-4c03-8316-8aa227fea159

CHANGELOG-NONE

cephalonaut and others added 4 commits June 30, 2026 15:17
Implements TECH.md steps C1-C3:
- Remove fully-rolled-out flags OrchestrationViewerStreamer and
  OwnerOrchestrationAncestorStreamer (enum, features.rs, Cargo.toml).
- Delete the legacy OrchestrationViewerModel REST polling path
  (fetch_children/apply_children_fetch/schedule_next_poll/
  maybe_kick_polling, interval consts, polling fields); the streamer-driven
  path is now the only path. pending_session_id_poll is retained (Task 2.1).
- Simplify desired_sse_filter to unconditionally use the ancestor
  (include_self) stream for parents; drop the now-dead UnsupportedRunIdCount
  variant, its match arms, and MAX_RUN_ID_STREAM_FILTER.
- Collapse the flag guard in terminal_manager::stop_orchestration_polling.
- Update tests for the flag-removal fallout.

No behavior change beyond removing the dead flag-off paths.

Co-Authored-By: Oz <oz-agent@warp.dev>
…d (warp C4-C10)

Consume the server-emitted `child_agent_started` event and open the
owner-side ancestor stream when a root first calls `wait_for_events`,
replacing the per-wait `get_ambient_agent_task` fetch and removing the
viewer `session_id` polling timer.

- C4: add `CHILD_AGENT_STARTED_EVENT` const; `lifecycle_event_type_from_wire`
  still returns None for it.
- C5: add `ancestor_on_wait` to `ConversationStreamState`.
- C6: replace `register_parent_on_wait` with `register_root_on_wait`
  (no network fetch); delete `finish_register_parent_on_wait`; update the
  `wait_for_events.rs` call site.
- C7: honor `ancestor_on_wait` in `is_eligible` and `desired_sse_filter`.
- C8: add ungated `register_children_from_events`, called from
  `drain_sse_events`, registering each `child_agent_started` ref_id into
  `watched_run_ids` (idempotent; reevaluates only on a newly inserted id).
- C9: remove the viewer `pending_session_id_poll` timer (field, methods,
  const); keep `spawn_task_metadata_fetch` driven by `handle_child_status_changed`.
- Update the `WaitForEventsParentRegistration` doc comment.

Tests: rewrite the wait-registration suite for `register_root_on_wait`
and add child_agent_started drain + unknown-event coverage; drop the
viewer poll-timer tests.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2026
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