Skip to content

fix(cli): block Tab key during AI streaming to prevent mode switch interruption#2211

Closed
Drakaniia wants to merge 1 commit intoQwenLM:mainfrom
Drakaniia:main
Closed

fix(cli): block Tab key during AI streaming to prevent mode switch interruption#2211
Drakaniia wants to merge 1 commit intoQwenLM:mainfrom
Drakaniia:main

Conversation

@Drakaniia
Copy link
Copy Markdown

TLDR

Fixes issue #2210 where accidentally pressing Tab while AI is actively responding would switch approval modes and interrupt the ongoing response and file edits.

Dive Deeper

The shouldBlockTab function in AppContainer.tsx previously only checked if autocomplete suggestions were visible. This PR adds an additional check for when the AI is actively streaming/responding.

Changes made:

  • Modified packages/cli/src/ui/AppContainer.tsx line 677
  • Updated shouldBlockTab to check both:
    • hasSuggestionsVisible (autocomplete is showing)
    • streamingState === StreamingState.Responding (AI is actively responding)

This ensures Tab key mode cycling is blocked during active AI operations, preventing accidental interruption of YOLO/auto-accept-edits mode workflows.

Reviewer Test Plan

  1. Start Qwen Code in YOLO mode: qwen -y
  2. Give the AI a task requiring multiple file edits
  3. While AI is responding/editing, press Tab
  4. Verify that mode does NOT switch and the response continues uninterrupted
  5. Verify Tab still works for autocomplete when AI is idle
  6. Verify Tab still cycles approval modes when AI is idle

Testing Matrix

🍏 🪟 🐧
npm run

Linked issues / bugs

Fixes #2210

@tanzhenxin
Copy link
Copy Markdown
Collaborator

@Drakaniia Hi, I understand your situation, but changing the approval mode during a run is actually a pretty common workflow, such as switching from default to yolo mode. I am not sure whether this would still be possible with the proposed fix.

Perhaps we should consider using a separate shortcut for switching approval modes on Windows. On macOS, the shortcut is Shift+Tab, but that key combination does not work on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Accidental tab switch to Plan mode interrupts YOLO/auto-accept-edits mode AI response and edits

2 participants