Skip to content

feat: add shortcuts for cycling orchestration subagents#11760

Open
oz-for-oss[bot] wants to merge 11 commits into
masterfrom
oz-agent/implement-issue-11734
Open

feat: add shortcuts for cycling orchestration subagents#11760
oz-for-oss[bot] wants to merge 11 commits into
masterfrom
oz-agent/implement-issue-11734

Conversation

@oz-for-oss
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot commented May 27, 2026

Closes #11734

Description

Adds editable Warp AI keybindings for cycling through orchestration sessions from the active agent-view pane. The new actions follow the same orchestration topology/pill-bar ordering as the UI, now cycle through both the orchestrator and its child agents, and reuse the existing reveal path so in-flight panes are preserved.

Default bindings:

  • Next orchestration session: ctrl-alt-tab on macOS, Linux, and Windows.
  • Previous orchestration session: ctrl-alt-shift-tab on macOS, Linux, and Windows.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • cargo fmt

  • git --no-pager diff --check

  • cargo test -p warp --lib ai::blocklist::orchestration_topology — 11 passed.

  • cargo test -p warp adjacent_orchestration_child_navigation — 4 passed.

  • cargo clippy --workspace --all-targets --all-features --tests -- -D warnings — attempted, blocked by missing generated channel config JSON files when release_bundle is enabled without warp-channel-config.

  • cargo clippy -p warp --lib --all-features --tests -- -D warnings

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

Screenshots / Videos

warp-oss.-.Build.Simple.HTML.Game.With.Subagents.-.29.May.2026.mp4

Agent Mode

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

CHANGELOG-IMPROVEMENT: Added keyboard shortcuts for cycling through orchestrator and subagent sessions in Agent Mode.

Co-Authored-By: Oz oz-agent@warp.dev

Co-Authored-By: Sathvik Vangavolu <113149539+vikvang@users.noreply.github.com>
@cla-bot cla-bot Bot added the cla-signed label May 27, 2026
@vikvang vikvang requested a review from advait-m May 27, 2026 22:22
@vikvang vikvang marked this pull request as ready for review May 27, 2026 22:23
@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented May 27, 2026

@vikvang

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

Copy link
Copy Markdown
Contributor Author

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

Choose a reason for hiding this comment

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

Overview

This PR adds editable keybindings for cycling through orchestration subagents and wires the actions through terminal view navigation using the orchestration topology helper.

Concerns

  • Cycling from nested subagents uses the immediate parent as the traversal root, so grandchildren do not cycle through the full orchestration pill-bar order.
  • This is a user-facing keyboard navigation change, but the PR description explicitly says no screenshots or screen recording were included. 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

Comment thread app/src/ai/blocklist/orchestration_topology.rs
@vikvang vikvang removed the request for review from advait-m May 27, 2026 23:28
@vikvang vikvang marked this pull request as draft May 29, 2026 20:56
Co-Authored-By: Oz <oz-agent@warp.dev>
@vikvang vikvang requested a review from vkodithala May 29, 2026 21:48
@vikvang vikvang marked this pull request as ready for review May 29, 2026 21:50
@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented May 29, 2026

@vikvang

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

Copy link
Copy Markdown
Contributor

vkodithala commented May 29, 2026

Meta-nit: we should probably change the Changelog message to smth that reflects the new keybind? i.e.,

CHANGELOG-IMPROVEMENT: Added keyboard shortcuts (ctrl-]\[ on Mac, ctrl-alt-]\[ on Windows) for cycling through orchestration subagent tabs in Agent Mode.

Copy link
Copy Markdown
Contributor Author

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

Choose a reason for hiding this comment

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

Overview

This PR adds editable terminal actions and keybindings for cycling between orchestration agent conversations, plus topology tests for adjacent navigation.

Concerns

  • The navigation helper uses raw descendant spawn order, but the rendered pill bar applies pin/status/recency ordering, so the keyboard shortcuts can move to a different conversation than the visible next/previous pill.
  • The default shortcuts are registered as ctrl-only bindings instead of the described cmd-alt/ctrl-alt bindings; the previous shortcut also collides with the terminal Escape control chord.

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

let orchestration_root_id = history
.resolved_parent_conversation_id_for_conversation(active_conversation)
.unwrap_or(active_conversation_id);
let descendant_ids = descendant_conversation_ids_in_spawn_order(history, orchestration_root_id);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This walks raw spawn pre-order, but the pill bar renders children after pin/status/recency sorting, so next/previous won't match the visible pill order whenever those states differ. Reuse the pill-bar ordering before wiring shortcuts to it.

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.

I think this is valid, we aren't accounting for pinned subagents. Can you TAL?

Comment thread app/src/terminal/view/init.rs Outdated
Copy link
Copy Markdown
Contributor

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

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

Looking good, left a few comments. Run a cargo fmt while you're at it to appease the formatter 🙏

Comment thread app/src/ai/blocklist/orchestration_topology.rs
let orchestration_root_id = history
.resolved_parent_conversation_id_for_conversation(active_conversation)
.unwrap_or(active_conversation_id);
let descendant_ids = descendant_conversation_ids_in_spawn_order(history, orchestration_root_id);
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.

I think this is valid, we aren't accounting for pinned subagents. Can you TAL?

Comment on lines +461 to +466
/// Navigate to the previous child agent conversation in the active
/// orchestration tree.
CyclePreviousOrchestrationChildAgent,
/// Navigate to the next child agent conversation in the active
/// orchestration tree.
CycleNextOrchestrationChildAgent,
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.

CyclePreviousOrchestrationChildAgent isn't the best name? Also idk if this should be two different variants, why not something like NextOrchestrationChildAgent { direction }?

Comment thread app/src/terminal/view/init.rs Outdated
Co-Authored-By: Oz <oz-agent@warp.dev>
@vikvang
Copy link
Copy Markdown
Contributor

vikvang commented Jun 1, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented Jun 1, 2026

@vikvang

I'm re-reviewing this pull request in response to a review 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

Copy link
Copy Markdown
Contributor Author

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

Choose a reason for hiding this comment

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

Overview

This PR adds editable TerminalView actions and default shortcuts for cycling through orchestrator/subagent conversations, plus shared topology ordering helpers and tests.

Concerns

  • The new default shortcuts use plain ctrl-[ / ctrl-], which the existing TerminalView binding validator treats as PTY control characters and rejects unless the action or keystroke is explicitly allowlisted. As written, the advertised defaults are not valid TerminalView bindings.

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

Comment thread app/src/terminal/view/init.rs Outdated
.with_context_predicate(
id!("Terminal") & id!(flags::IS_ANY_AI_ENABLED) & id!(flags::ACTIVE_AGENT_VIEW),
)
.with_mac_key_binding("ctrl-]")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] ctrl-] and the ctrl-[ binding below match CONTROL_CHARACTER_KEY_REGEX, and TerminalView registers is_binding_pty_compliant, so these defaults are rejected unless this action is explicitly allowlisted or a PTY-compliant shortcut is used.

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.

Can you confirm?

oz-agent added 3 commits June 1, 2026 10:41
…lidator

Co-Authored-By: Oz <oz-agent@warp.dev>
…nflicts

Co-Authored-By: Oz <oz-agent@warp.dev>
@vkodithala vkodithala requested review from vikvang and vkodithala June 4, 2026 21:00
Copy link
Copy Markdown
Contributor

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

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

Generally I have a few questions, but the logic looks good!

Comment on lines 646 to 648
// Walk the full descendant tree in pre-order, preserving each
// parent's child registration order so nested branches stay
// contiguous and grandchildren remain visible in the row.
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.

Is this comment now outdated? Can we also make sure that there's isn't downstream logic we are breaking by making this change?

Comment on lines +70 to +74
/// Returns descendants sorted in the same visual ordering used by the
/// orchestration pill bar:
/// 1) pinned children
/// 2) unpinned children
/// each bucket ordered by status priority, then done-recency, then spawn order.
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.

If this logic is also used for ordering by the orchestration pill bar, is there an opportunity to centralize logic? We're probably reiterating the same logic 2x, can you check and see if we can reuse?

Comment thread app/src/terminal/view/init.rs Outdated
.with_context_predicate(
id!("Terminal") & id!(flags::IS_ANY_AI_ENABLED) & id!(flags::ACTIVE_AGENT_VIEW),
)
.with_mac_key_binding("ctrl-]")
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.

Can you confirm?

Comment thread app/src/terminal/view.rs Outdated
Comment on lines +4768 to +4793
fn cycle_orchestration_child_agent(
&mut self,
direction: OrchestrationNavigationDirection,
ctx: &mut ViewContext<Self>,
) {
let active_conversation_id = self
.agent_view_controller
.as_ref(ctx)
.agent_view_state()
.active_conversation_id();
let Some(active_conversation_id) = active_conversation_id else {
return;
};
let target_conversation_id = adjacent_orchestration_child_conversation_id(
BlocklistAIHistoryModel::as_ref(ctx),
active_conversation_id,
direction,
);
let Some(target_conversation_id) = target_conversation_id else {
return;
};

ctx.emit(Event::RevealChildAgent {
conversation_id: target_conversation_id,
});
}
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.

We use TerminalView a lot and I'm a little wary of adding onto it. This is feedback Pei gave me earlier, and something DS cares about too. Is it absolutely necessary to include this here?

Comment thread app/src/util/bindings.rs Outdated
// on TerminalView on all platforms.
Keystroke::parse("ctrl-c").expect("should be able to construct ctrl-c keystroke"),
// Orchestration conversation cycling defaults use ctrl-[ / ctrl-] on all platforms.
// These intentionally overlap PTY control characters and are validated here.
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.

What does this mean? Is this what we want? I want to make sure we aren't regressing anything important here.

Co-Authored-By: Oz <oz-agent@warp.dev>
@vikvang
Copy link
Copy Markdown
Contributor

vikvang commented Jun 4, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor Author

oz-for-oss Bot commented Jun 4, 2026

@vikvang

I'm re-reviewing this pull request in response to a review 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

Copy link
Copy Markdown
Contributor Author

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

Choose a reason for hiding this comment

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

Overview

This PR adds editable Warp AI keybindings for cycling through orchestration conversations, factors pill ordering into the shared topology helper, and covers the direct child navigation and binding cases with tests.

Concerns

  • No blocking correctness, security, or spec-drift concerns found. The attached spec context reports no approved repository spec.
  • The inline suggestions align the keybinding labels with the implemented behavior, which includes cycling back to the orchestrator.

Verdict

Found: 0 critical, 0 important, 2 suggestions

Approve with nits

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/terminal/view/init.rs Outdated
Comment thread app/src/terminal/view/init.rs Outdated
vikvang and others added 3 commits June 5, 2026 18:04
Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com>
Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com>
Co-Authored-By: Oz <oz-agent@warp.dev>
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.

Add keyboard shortcut to cycle through orchestration subagents in a pane

3 participants