Fix cmd-enter block attachment not starting a new conversation#12433
Closed
MaggieShan wants to merge 1 commit into
Closed
Fix cmd-enter block attachment not starting a new conversation#12433MaggieShan wants to merge 1 commit into
MaggieShan wants to merge 1 commit into
Conversation
A recent change gated keybinding-triggered `/agent` and `/new` behind a second-press confirmation when the user is already in an active, non-empty conversation. This protects against accidental conversation resets, but it also broke the common flow of selecting a block (or text) and pressing `cmd-enter` to start a new conversation with that block attached: the first press only armed the confirmation instead of starting the conversation. When the user has deliberately attached context (selected blocks, selected text, image/file attachments, or a document), their intent to start a new conversation is unambiguous, so we skip the confirmation and proceed in a single step. The muscle-memory protection is preserved for the empty-handed case. 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
Pressing
cmd-enterwhile a block (or text) is selected stopped starting a new conversation with that block attached as context. The block-attach flow now works again in a single press.Root cause
A recent change (
should_start_new_conversation_for_keybinding) gates keybinding-triggered/agent//newbehind a second-press confirmation when the user is already in an active, non-empty conversation. This guards against accidental conversation resets from reflexive keypresses, but it also intercepted the deliberate "select a block →cmd-enter" flow: the first press only armed the confirmation rather than starting the conversation, so the block was never attached.Fix
In
Input::execute_slash_command, when the user has deliberately attached context (selected blocks, selected text, image/file attachments, or a document) we now skip the confirmation and start the new conversation in a single step. A newBlocklistAIContextModel::has_pending_user_context()helper centralizes that check. Auto-attached agent-view blocks are intentionally excluded since they are not a deliberate user selection. The muscle-memory protection is preserved for the empty-handed case.Linked Issue
ready-to-specorready-to-implement.Testing
Added unit tests for
has_pending_user_contextcovering the default (empty) state and the pending-block, pending-selected-text, and pending-attachment cases.cargo check -p warp --testsandcargo clippy -p warp --lib -- -D warningsboth pass../script/runAgent Mode
Conversation: https://staging.warp.dev/conversation/c4254450-1bca-436d-a75d-48d7b2f5094d
Run: https://oz.staging.warp.dev/runs/019eae75-a9f0-784c-923e-475937db7038
This PR was generated with Oz.