Skip to content

extract orchestration edit state into a frontend-neutral module#13707

Merged
harryalbert merged 4 commits into
masterfrom
harry/code-1822-edit-state
Jul 15, 2026
Merged

extract orchestration edit state into a frontend-neutral module#13707
harryalbert merged 4 commits into
masterfrom
harry/code-1822-edit-state

Conversation

@harryalbert

@harryalbert harryalbert commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Extracts the orchestration run-config editing domain out of the GUI-only orchestration_controls.rs into a frontend-neutral app/src/ai/orchestration/ module, so the TUI orchestration card (upstack in this stack) can share the exact same state, transitions, and validation as the GUI confirmation card and plan-card config block. No behavior change intended.

The module is split into:

  • config_state.rsOrchestrationConfigState (the run-wide model/harness/execution-mode/auth fields; renamed from the old OrchestrationEditState) and AuthSecretSelection.
  • edit_state.rs — the new OrchestrationEditState (config state + per-harness model memory) and the apply_execution_mode_change / apply_harness_change / revalidate_after_catalog_change transitions, consolidated from loose GUI helper functions into state methods. Each has a _core variant with injected catalog callbacks so transitions are unit-testable without app singletons.
  • validation.rs — Accept gating and picker-visibility predicates, plus harness_is_selectable (extracted from inline picker filtering so both frontends filter identically).
  • providers.rsAppContext-backed catalog lookups, default host/environment/auth-secret resolution, and persistence helpers.

Review guide

New code:

  • app/src/ai/orchestration/edit_state.rs — the only substantially new code: the consolidated transitions and the config-state/model-memory split. Previously this logic was interleaved with picker repopulation in apply_harness_change / apply_execution_mode_change / repopulate_all_pickers in orchestration_controls.rs; behavior should be identical.
  • app/src/ai/blocklist/inline_action/run_agents_card_view.rs — the card's RunAgentsEditState is split into run-wide config vs card-only fields, and per-harness model memory moves off the view onto OrchestrationEditState. Mostly mechanical, but this is where a behavior regression would hide.

Skim (moved code, bodies unchanged):

  • app/src/ai/orchestration/config_state.rs, providers.rs, and most of validation.rs — cut/paste from orchestration_controls.rs (and can_execute_with_auth_secret / populate_default_auth_secret_for_execution from the run_agents.rs executor), with GUI-typed ViewContext params relaxed to AppContext.
  • app/src/ai/blocklist/inline_action/orchestration_controls.rs — almost entirely deletions plus re-exports of the moved items; what remains is GUI rendering/picker population only.

Skim (mechanical caller churn):

  • orchestration_config_block.rs, run_agents.rs, queued_query_tests.rs, run_agents_card_view_tests.rs — renames to the new paths/field names.
  • app/src/ai/mod.rs, orchestration/mod.rs, tui_export.rs — wiring/exports.
  • specs/code-1822-edit-state/TECH.md — the tech spec for this slice.

Testing

  • I have manually tested my changes locally with ./script/run

Agent Mode

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

@cla-bot cla-bot Bot added the cla-signed label Jul 14, 2026

harryalbert commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

harryalbert and others added 2 commits July 14, 2026 18:26
Compose RunAgentsEditState from config state + card fields, rename
transitions module to edit_state, drop the constant should_show_harness_picker
seam, and trim doc comments.

Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert
harryalbert force-pushed the harry/code-1822-edit-state branch from 22bc7be to 97993fd Compare July 14, 2026 22:30
Drop constructor-mapping, setter, and selectability tests whose behavior
is covered by the accept-gate and snapshot-level tests; keep transition,
gating, and catalog-revalidation policy tests.

Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert
harryalbert marked this pull request as ready for review July 14, 2026 23:27
@harryalbert
harryalbert requested a review from cephalonaut July 14, 2026 23:27
@oz-for-oss

oz-for-oss Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@harryalbert

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@harryalbert
harryalbert requested review from moirahuang and removed request for cephalonaut July 14, 2026 23:27

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR extracts orchestration run-config edit state and validation into a frontend-neutral module and updates the GUI confirmation card, plan-card config block, executor helpers, exports, and tests to use the new shared types.

Concerns

  • For this user-facing change, please include screenshots or a screen recording demonstrating the orchestration confirmation card and plan-card config block still working end to end. The diff changes the rendered picker/editor paths for those UI surfaces, but the PR description only mentions manual ./script/run testing and does not include visual evidence.

Verdict

Found: 0 critical, 1 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

@moirahuang moirahuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phew this was more just moving around code than logic change but i got scared by the LOC changed

@harryalbert
harryalbert force-pushed the harry/code-1822-edit-state branch from 23b2eb1 to 932a2bf Compare July 15, 2026 13:35
@harryalbert
harryalbert merged commit 9bc9919 into master Jul 15, 2026
40 of 42 checks passed
@harryalbert
harryalbert deleted the harry/code-1822-edit-state branch July 15, 2026 16:34
ErshovDmitry added a commit to ErshovDmitry/warp-i18n that referenced this pull request Jul 16, 2026
…arpdotdev#13707/warpdotdev#13714)

Upstream sync (merge f71f181) extracted orchestration UI config into
app/src/ai/orchestration/ with raw English literals — our menu_label wraps
regressed in 4 files. Restore ~14 sites. Keys exist in en.yml.

- snapshots.rs: 4 const->fn (DEFAULT_MODEL_LABEL, AUTH_SECRET_INHERIT_LABEL,
  CUSTOM_HOST_LABEL, AUTH_SECRETS_LOAD_FAILED_MESSAGE) + 5 inline wraps
- providers.rs: ORCHESTRATION_ENV_NONE_LABEL const->pub fn (snake_case, lint-clean)
- validation.rs: 3 inline fn-return wraps (.to_string() preserved)
- config_state.rs: 1 inline method-return wrap (Option<&'static str>, no .to_string())
- mod.rs + tui_export.rs: re-exports updated (const->fn rename)
- orchestration_controls.rs + snapshots_tests.rs: consumer call-sites updated
- en/ru.yml: 3 new keys (custom_host, no_harnesses_available, no_models_available)

Russian: custom_host=Свой хост… (custom_inference precedent ru.yml:1513),
no_harnesses_available=Среды исполнения недоступны (no_tools_available precedent),
no_models_available=Модели недоступны.

Plans: 28ae0e1e + 215807cc (2 plan-review cycles — P 🔴=0;
2 code-review cycles — 🔴=0 🟡=0 🔵=2 cosmetic dismissed).
Gate: cargo check 0 NEW warnings (5 baseline mcp/), cargo test -p i18n 12/12,
orchestration tests 34/34, rustfmt clean, en/ru parity 23/23.

Deferred: host_picker.rs:54 separate CUSTOM_HOST_LABEL (different module, micro-plan TBD).
@harryalbert harryalbert mentioned this pull request Jul 16, 2026
4 tasks
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.

2 participants