Stage 2 Client: OrchestrationConfig on Plan Card + Auto-Launch + Disabled Card#9927
Draft
cephalonaut wants to merge 10 commits intomatthew/orchestration-tool-2from
Draft
Stage 2 Client: OrchestrationConfig on Plan Card + Auto-Launch + Disabled Card#9927cephalonaut wants to merge 10 commits intomatthew/orchestration-tool-2from
cephalonaut wants to merge 10 commits intomatthew/orchestration-tool-2from
Conversation
…ypes - Add OrchestrationConfig, OrchestrationExecutionMode, OrchestrationConfigStatus types in crates/ai/src/agent/orchestration_config.rs with matches_active_config() pure function and proto round-trip conversions (15 unit tests). - Extract shared orchestration controls into app/src/ai/blocklist/inline_action/orchestration_controls.rs: OrchestrationEditState, OrchestrationControlAction trait, generic picker creation/population/sync/render helpers (~720 lines). - Refactor RunAgentsCardView to delegate to shared module (1394→850 lines). All 19 existing card view tests pass unchanged. Co-Authored-By: Oz <oz-agent@warp.dev>
- Add conversation-level orchestration config fields: orchestration_config, orchestration_status, orchestration_plan_id, dirty_orchestration_event - Add DirtyOrchestrationEvent struct for dirty-sync transport - Add OrchestrationConfigUpdated event variant - Add accessors: active_orchestration_config(), orchestration_status(), dirty_orchestration_event(), clear_dirty_orchestration_event() - Add mutators: set_orchestration_config(), set_orchestration_status() - Add hydrate_orchestration_config_from_snapshot() for server snapshot ingestion - Handle new event variant in AIDocumentView and PlanAndTodoListView matches Co-Authored-By: Oz <oz-agent@warp.dev>
- Create OrchestrationConfigBlockView in app/src/ai/document/orchestration_config_block.rs with 'Use orchestration' toggle, Cloud/Local mode selector, and all picker dropdowns (harness, host, environment, base model) using shared controls. - Approved state shows full controls; disapproved state hides them. - Embed config block in AIDocumentView render above the editor content, conditionally shown when AIDocumentModel has an active orchestration config. - Subscribe to OrchestrationConfigUpdated events for re-rendering. - Field edits and toggle changes route through AIDocumentModel.set_orchestration_config() which sets the dirty flag for the dirty-sync transport (Phase 4). Co-Authored-By: Oz <oz-agent@warp.dev>
- Add AIAgentInput::OrchestrationConfigUpdate variant for piggybacking user config edits on outbound requests. - Hook BlocklistAIController.send_query() to collect the dirty event from AIDocumentModel before send_request_input, and clear it after. - Extend convert_input_to_user_input() to convert OrchestrationConfigUpdate to the proto OrchestrationConfigUpdate UserInput wire format. - Handle new variant in all exhaustive match statements across the codebase (redaction, persistence, telemetry, SDK driver, view_impl, etc.). Co-Authored-By: Oz <oz-agent@warp.dev>
Add auto-launch path: when the active orchestration config is approved and matches the request, the card immediately dispatches execute_run_agents() and renders in spawning state from the start (no confirmation UI). Add denied card: at construction, detect existing Denied results in history and render a static disabled card with Cancelled styling. Thread active orchestration config from AIDocumentModel through AIBlock::ensure_run_agents_card_view() to RunAgentsCardView::new(). Co-Authored-By: Oz <oz-agent@warp.dev>
The Flex::column() wrapping the editor gave unbounded height to its children. The editor's Scrollable requires a finite height constraint. Fix by making the editor an Expanded child so it fills remaining space after the config block with a bounded constraint. Co-Authored-By: Oz <oz-agent@warp.dev>
- Remove unused imports OrchestrationConfig and ModelHandle in orchestration_config_block.rs - Fix unused closure parameter ctx -> _ in controller.rs - Replace .clone() with copy dereference for UiComponentStyles in orchestration_controls.rs Co-Authored-By: Oz <oz-agent@warp.dev>
AIDocumentModel was missing the subscription to BlocklistAIHistoryModel that triggers scanning for OrchestrationConfigSnapshot messages in the conversation task list. Without this, the server-set config never populated the model and the plan card config block never appeared. - Subscribe to AppendedExchange, UpdatedStreamingExchange, and RestoredConversations events - Scan all tasks in the conversation for the OrchestrationConfigSnapshot message variant - Clone the snapshot to release the history borrow before calling hydrate_orchestration_config_from_snapshot with &mut ctx Co-Authored-By: Oz <oz-agent@warp.dev>
Auto-launch was triggering unintentionally because AIDocumentModel is a singleton that carries orchestration config across conversations. A config set in one conversation would cause run_agents calls in unrelated conversations to auto-launch without showing the confirmation card. Disable auto-launch entirely (hardcode false) until the active config is properly scoped to the owning conversation. The confirmation card flow continues to work normally. 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
Stage 2 client implementation for the
run_agentsorchestration tool. Builds on top of Stage 1 (in review onmatthew/orchestration-tool-2).What: Adds plan-attached
OrchestrationConfigwith inline config block on plan cards, client-side auto-launch when arun_agentscall matches the active approved config, server-immediate-deny rendering (disabled card) when the user has disapproved orchestration, and dirty-sync transport to piggyback user config edits on outbound requests.Key changes:
RunAgentsCardViewinto a reusableorchestration_controls.rsmodule withOrchestrationControlActiontrait for action-type generics. Refactored the Stage 1 card to use it (1394→850 lines, all 19 tests pass).OrchestrationConfig,OrchestrationExecutionMode,OrchestrationConfigStatusincrates/aiwithmatches_active_config()pure function and proto round-trip conversions (15 unit tests).OrchestrationConfigUpdatedevent, hydration fromOrchestrationConfigSnapshotmessages, dirty-event lifecycle.OrchestrationConfigBlockViewwith "Use orchestration" toggle, Cloud/Local mode selector, harness/host/environment/model dropdowns. Embedded inAIDocumentViewabove the editor.AIAgentInput::OrchestrationConfigUpdatevariant piggybacked on outbound requests viaBlocklistAIController.send_query().RunAgentsCardViewskips confirmation when active config is Approved and matches the call fields.RunAgentsResult::Denied.Telemetry outcome differentiation (
auto_launched,approved,approved_modified,disapproved) is deferred.Plan · Conversation
Testing
matches_active_config()covering exact match, per-field mismatches, empty field inheritance, non-match-check field exclusion, and proto round-tripsRunAgentsCardViewtests pass after refactorcargo fmtandcargo checkpassAgent Mode
Co-Authored-By: Oz oz-agent@warp.dev