Fix orchestration viewer: defer child registration when parent conversation not yet available (REMOTE-2141)#13665
Draft
seemeroland wants to merge 1 commit into
Draft
Conversation
…sation not yet available When viewing a cloud Oz orchestrated run (via session link), child agent placeholder conversations were not being created in the viewer model, causing: - Missing agent chips (orchestration pill bar) in the session view - Child agents showing as 'Unknown agent' in the conversation transcript Root cause: a race condition in . When child tasks are fetched from the server (via ancestor seed fetch or legacy polling), may return None because the parent conversation hasn't been set as active yet (StreamInit hasn't been processed). Previously, this dropped the task with no retry, meaning chips and agent names never appeared. Fix: - Store failed-to-register tasks in a new queue instead of dropping them - Flush the queue when the parent conversation becomes available (on or events for the viewer's terminal surface) - Also flush deferred tasks when the legacy polling path resumes from idle (on an orchestrator-scoped ) - Fix the legacy polling path's flag: only enter idle when the server truly returned no tasks, not when tasks were received but deferred due to a missing parent conversation REMOTE-2141 Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a regression where orchestration agent chips (pill bar) were missing and child agents showed as "Unknown agent" when viewing a cloud Oz orchestrated run's session in the Warp client.
Root cause: A race condition in
OrchestrationViewerModel::register_child. When the orchestration viewer first discovers child runs (via ancestor seed fetch or legacy polling),find_parent_conversation_idcan returnNonebecause the parent conversation hasn't been established yet — theStreamInitevent from the shared session hasn't been processed. Previously, child tasks were silently dropped with no retry, so chips and agent names never appeared.Additionally, in the legacy polling path, when all child tasks failed to register (because the parent wasn't available),
idle_due_to_no_children = truewas set incorrectly. This stopped all future polling — even once the parent conversation became available — permanently preventing chips from appearing for completed/historical runs.Fix:
deferred_tasksqueue: whenregister_childcan't find the parent conversation, store the task instead of dropping itSetActiveConversation/ConversationServerTokenAssignedevents (streaming path)AppendedExchangewhen idle polling resumes (legacy path)idle_due_to_no_childrenflag: only enter idle when the server truly returned no tasks, not when tasks were received but deferredLinked Issue
Linear: REMOTE-2141
ready-to-specorready-to-implement.Testing
./script/runThis fix addresses a race condition in the orchestration viewer model. Existing tests in
orchestration_viewer_model_tests.rscontinue to pass. The change adds thedeferred_tasksfield to the struct and updates thesetup_modeltest helper accordingly.Agent Mode
Conversation: https://staging.warp.dev/conversation/e62aba4c-20f8-4129-a8b9-adaadd08f4c8
Run: https://oz.staging.warp.dev/runs/019f5cde-2c2d-7ac3-b8b7-f0d0945220bf
This PR was generated with Oz.