Skip to content

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

@Drakaniia

Description

@Drakaniia

Bug Report

What happened?

When using YOLO mode (-y flag) or auto-accept-edits mode, if I accidentally press the tab key that switches to Plan mode, the AI response gets interrupted and the edit doesn't continue. The mode switch causes the ongoing response to be skipped/cancelled.

This is problematic because:

  1. The tab key is easily hit accidentally during normal usage
  2. An in-progress AI response and file edits are lost
  3. There's no way to recover the interrupted response
  4. The mode switch should not affect ongoing operations

What did you expect to happen?

When an AI response is actively streaming or edits are being applied:

  1. Tab key presses should be ignored/buffered until the current operation completes
  2. Mode switches should not interrupt ongoing AI responses or edit applications
  3. If a mode switch is requested during an active operation, it should either:
    • Be queued and applied after the operation completes
    • Show a warning that the operation must complete first
    • Be completely ignored until the operation finishes

The mode state should remain in YOLO/auto-accept-edits mode until the AI finishes its current response and all edits are applied.

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

$ qwen /about
# Please paste the output here

Login information

No response

Anything else we need to know?

Affected components:

  • packages/cli/src/ui/ - Tab key handling and mode switching logic
  • packages/vscode-ide-companion/ - VS Code extension mode switching
  • Mode switching implementation across both CLI and IDE extensions

Suggested fix approach:

  1. Add a check for ongoing AI responses before processing mode switch requests
  2. Implement a "lock" mechanism during active operations that prevents mode changes
  3. Consider adding a confirmation dialog for mode switches during active operations (optional)
  4. Ensure the tab key handler checks operation state before triggering mode switch

Reproduction steps:

  1. Start Qwen Code in YOLO mode: qwen -y
  2. Give the AI a task that requires multiple file edits
  3. While the AI is responding/editing files, press the tab key
  4. Observe that the mode switches to Plan mode and the response/editing stops

Related behavior:
This issue affects both:

  • Terminal CLI with tab key mode cycling
  • VS Code extension with mode switching

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions