QUALITY-928: Orchestration unified stack — core tracker + family stream (M1) - #14473
QUALITY-928: Orchestration unified stack — core tracker + family stream (M1)#14473cephalonaut wants to merge 3 commits into
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds the dogfood-gated unified orchestration child tracker, family-stream event classification/drain paths, placeholder hydration wiring, and tests.
Concerns
- The metadata-fetch guard in
OrchestrationChildTrackeris never cleared after an async cache miss, so laterStarted/Lifecyclere-drives return before consulting the now-populated task cache. This prevents out-of-band child discovery/status routing from completing after the first miss. - This is a user-facing behavior change to orchestration child tracking/pill state, but the PR description has no screenshots or screen recording. For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| run_id: &str, | ||
| ctx: &mut ModelContext<OrchestrationEventStreamer>, | ||
| ) { | ||
| if !self.metadata_fetches.insert(run_id.to_string()) { |
There was a problem hiding this comment.
get_or_async_fetch_task_data only emits TasksUpdated when the fetch completes, and nothing calls apply_seeded or removes metadata_fetches. Subsequent Started/Lifecycle re-drives hit this early return and never consult the warmed cache, so out-of-band children can remain undiscovered and never receive status updates.
There was a problem hiding this comment.
Fixed: when a re-drive hits the existing guard, spawn_metadata_fetch now immediately re-polls the cache via get_or_async_fetch_task_data. On a warm cache it calls apply_seeded and removes the guard inline (lines 430–436); on a miss the shared in-flight fetch will complete and a later TasksUpdated re-drive picks it up. The guard exists only to deduplicate concurrent dispatches, not to block re-polling.
… event consumer Introduces the client-side orchestration child tracking architecture: - OrchestrationChildTracker: single observe_child entry point for all child signals (child_agent_started, session_linked, lifecycle, seeded, registered). Inserts a TrackedChild immediately on Started so subsequent signals race-safe. - FamilyDrainMode replaces OrchestrationEventConsumer as the sole mode axis: Primary pushes the server cursor and forwards child lifecycle to handle_event_batch; Observer persists the cursor locally only. - TrackedChild holds no conversation_id (removed race risk); run_id is the stable identity key. - ChildSignal::Registered is a unit variant; stamp_conversation_id_for_run removed. - ensure_remote_child_placeholder creates a local is_remote_child placeholder on child_agent_started so the pill bar reflects the child immediately. - drain_family_events classifies every SSE event as ParentSelf, ChildStarted, ChildSessionLinked, ChildLifecycle, or Opaque and routes accordingly. - OrchestrationUnifiedStack feature flag gates all flag-ON code paths. Co-Authored-By: Oz <oz-agent@warp.dev>
d957cd3 to
cedb591
Compare
Describe the unified orchestration child stack as it exists in the committed code: discovery via the parent ancestor SSE, the child tracker state machine, task-driven pane materialization, the ancestor-list restore seed, observer-mode discovery, the flag-off path, and the invariants each depends on. Adds a breakdown of discovery and materialization for each parent/child locality combination. Co-Authored-By: Warp Agent <agent@warp.dev>
|
For the demo, see the Loom on M2 (https://www.loom.com/share/5feec7c256044f03a5d63d2c46fe4a75) which covers the full end-to-end flow including pill bar, child attribution, and restore. M1 is the tracker foundation — the user-visible behavior lands together with M2. |
Master added execution_location to AmbientAgentTask after M1 branched. CI tests the merge commit (M1 + master), so the struct literals in our tracker and streamer tests need this field. Co-Authored-By: Oz <oz-agent@warp.dev>
Description
Introduces the orchestration child tracking foundation for the unified orchestration stack (QUALITY-928).
What
OrchestrationChildTracker: a singleobserve_childentry point for every child signal — discovery, session link, lifecycle, REST seed, and in-band registration.Startedkicks off a deduped metadata fetch; theTrackedChildis inserted when that resolves.FamilyDrainMode(Primary/Observer) is the sole mode axis. Primary delivers parent-self events and writes the server cursor; Observer drops parent-self events and persists the cursor locally only.TrackedChildholds noconversation_id.ChildSignal::Registeredis a unit variant.ensure_remote_child_placeholdercreates a localis_remote_childplaceholder onchild_agent_started, with a child-lifecycle backstop for missed discovery events.drain_family_eventsclassifies each event on the family SSE stream and routes it to the tracker or to parent-self delivery.FeatureFlag::OrchestrationUnifiedStackgates all flag-ON code paths; flag-OFF falls back to the existing per-conversation and ancestor-only drains unchanged.Why
A single observer entry point with a clear Primary/Observer distinction makes child tracking auditable and race-safe. The unified tracker is the foundation M2 builds on for pane materialization and task-driven restore.
Linked Issue
QUALITY-928
Testing
orchestration_child_tracker_tests.rs: observe_child idempotency, tombstone skip, fetch dedup, lifecycle-first discovery, and viewer child placeholder behavior.orchestration_event_streamer_tests.rs: FamilyEvent classification, drain routing, Primary parent delivery, Observer local-only cursor, and child-status routing.I have manually tested my changes locally with
./script/runAgent Mode