Skip to content

Conversation

@stanislavHamara
Copy link
Contributor

Problem

When the agent is processing a long-running prompt, sending a predefined slash command (like /yolo) via the completion popup would:

  1. Freeze the agent - the stream would stop and never continue
  2. Get queued instead of executing immediately

Root Cause

The completion popup's auto-submit feature bypasses the editor's working check, allowing slash commands to be sent while the agent is busy. When processMessage received these commands, it would:

  1. Call msgCancel() first, cancelling the running stream
  2. Then recognize the slash command and return early without starting a new stream
  3. Result: cancelled stream with nothing to replace it → freeze

Solution

Commit 1: Don't cancel when running commands

  • Move the slash command check (ParseSlashCommand) before the msgCancel() call
  • Predefined slash commands now return early without touching the running stream

Commit 2: Don't queue predefined commands

  • In handleSendMsg, check for predefined slash commands first
  • If it's a predefined command (/yolo, /exit, /compact, etc.), execute immediately
  • Custom agent commands (defined in config) still get queued as expected

Behavior After Fix

Command Type While Agent Working
Predefined (/yolo, /exit, /compact) Executes immediately, stream continues
Custom agent command (/fix-lint) Queued
Regular message Queued

@stanislavHamara stanislavHamara requested a review from a team as a code owner January 20, 2026 11:34
@stanislavHamara stanislavHamara merged commit 40d3598 into docker:main Jan 20, 2026
5 checks passed
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.

3 participants