Esc key doesn't interrupt AI generation in the Opencode VS Code extension #2881

Open
opened 2026-02-16 17:37:40 -05:00 by yindo · 11 comments
Owner

Originally created by @mossbergmaverick on GitHub (Nov 15, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When using the Opencode extension in VS Code, pressing the Esc key does not stop the AI generation process.
Expected behavior:
Pressing Esc should interrupt/stop the ongoing AI response generation.
Actual behavior:
The Esc key has no effect - the AI continues generating the response and cannot be interrupted.

Environment:

VS Code version: 1.105.1 (Universal)
Opencode version: v1.0.65
Opencode extension version: 0.0.12

OpenCode version

v1.0.65

Steps to reproduce

  1. Give a task/prompt to the AI in the Opencode extension
  2. While the AI is generating a response, press Esc to try to stop it
  3. The AI generation continues and cannot be stopped

Screenshot and/or share link

No response

Operating System

macOS 15.6

Terminal

No response

Originally created by @mossbergmaverick on GitHub (Nov 15, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When using the Opencode extension in VS Code, pressing the Esc key does not stop the AI generation process. Expected behavior: Pressing Esc should interrupt/stop the ongoing AI response generation. Actual behavior: The Esc key has no effect - the AI continues generating the response and cannot be interrupted. Environment: VS Code version: 1.105.1 (Universal) Opencode version: v1.0.65 Opencode extension version: 0.0.12 ### OpenCode version v1.0.65 ### Steps to reproduce 1. Give a task/prompt to the AI in the Opencode extension 2. While the AI is generating a response, press Esc to try to stop it 3. The AI generation continues and cannot be stopped ### Screenshot and/or share link _No response_ ### Operating System macOS 15.6 ### Terminal _No response_
yindo added the bug label 2026-02-16 17:37:40 -05:00
Author
Owner

@mossbergmaverick commented on GitHub (Nov 15, 2025):

I double-checked again: this problem is not limited to the VSCode extension and is related to the permission dialog not being displayed. If I remove

permission:
  edit: ask

then ESC works every time, both during agent generation and when the sub-agent executes a task.

@mossbergmaverick commented on GitHub (Nov 15, 2025): I double-checked again: this problem is not limited to the VSCode extension and is related to the permission dialog not being displayed. If I remove ``` permission: edit: ask ``` then ESC works every time, both during agent generation and when the sub-agent executes a task.
Author
Owner

@rekram1-node commented on GitHub (Nov 16, 2025):

Image

@mossbergmaverick I can't replicate? You can't get permission dialogs to show up ever?

Was this specifically with a subagent?

@rekram1-node commented on GitHub (Nov 16, 2025): <img width="1015" height="486" alt="Image" src="https://github.com/user-attachments/assets/8ab71c96-1ccd-4ce1-a37b-58871efe004a" /> @mossbergmaverick I can't replicate? You can't get permission dialogs to show up ever? Was this specifically with a subagent?
Author
Owner

@mossbergmaverick commented on GitHub (Nov 16, 2025):

Was this specifically with a subagent?

I apologize for the imprecise description. Here's my specific use case:

  1. Create an agent with configuration in an .md file
  2. Create a subagent in a second file with configuration in an .md file, set ask permissions for write and edit operations
  3. Ask the agent to assign a write and edit task to the subagent

In this scenario, the permission dialog doesn't appear and the ESC button fails to interrupt the process.

@mossbergmaverick commented on GitHub (Nov 16, 2025): > Was this specifically with a subagent? I apologize for the imprecise description. Here's my specific use case: 1. Create an agent with configuration in an .md file 2. Create a subagent in a second file with configuration in an .md file, set ask permissions for write and edit operations 3. Ask the agent to assign a write and edit task to the subagent In this scenario, the permission dialog doesn't appear and the ESC button fails to interrupt the process.
Author
Owner

@rekram1-node commented on GitHub (Nov 17, 2025):

Gotcha yeah, currently the permission modals only show up for subagnets if you go to the subagnet view, this is confusing and non ideal I will fix

@rekram1-node commented on GitHub (Nov 17, 2025): Gotcha yeah, currently the permission modals only show up for subagnets if you go to the subagnet view, this is confusing and non ideal I will fix
Author
Owner

@pawelel commented on GitHub (Nov 20, 2025):

It often doesn’t stop with ESC in the JetBrains Rider console either.
I don't use subagents, only have Plan/Build. There is an animation (progress bar?), which can't be stopped either. I can type "STOP", but it goes to a queue.

@pawelel commented on GitHub (Nov 20, 2025): It often doesn’t stop with ESC in the JetBrains Rider console either. I don't use subagents, only have Plan/Build. There is an animation (progress bar?), which can't be stopped either. I can type "STOP", but it goes to a queue.
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

We made it so that if a subagent needs permission the tui will automatically navigate to the subagent session so you can see what is happening in scope

@rekram1-node commented on GitHub (Nov 21, 2025): We made it so that if a subagent needs permission the tui will automatically navigate to the subagent session so you can see what is happening in scope
Author
Owner

@pawelel commented on GitHub (Nov 28, 2025):

Image There is nothing I can do except CTRL C.

@pawelel commented on GitHub (Nov 28, 2025): <img width="295" height="616" alt="Image" src="https://github.com/user-attachments/assets/6636330b-23d3-4f5c-b920-2cd80eff7b87" /> There is nothing I can do except CTRL C.
Author
Owner

@mossbergmaverick commented on GitHub (Dec 1, 2025):

We made it so that if a subagent needs permission the tui will automatically navigate to the subagent session so you can see what is happening in scope

Does the auto-navigation work currently? I'm not seeing the session switch automatically. Does this mean the fix for the permission modals is still in progress, or are these separate issues?

@mossbergmaverick commented on GitHub (Dec 1, 2025): > We made it so that if a subagent needs permission the tui will automatically navigate to the subagent session so you can see what is happening in scope Does the auto-navigation work currently? I'm not seeing the session switch automatically. Does this mean the fix for the permission modals is still in progress, or are these separate issues?
Author
Owner

@rekram1-node commented on GitHub (Dec 1, 2025):

@mossbergmaverick yeah that should work, it switches to the child session automatically that needs permission

@rekram1-node commented on GitHub (Dec 1, 2025): @mossbergmaverick yeah that should work, it switches to the child session automatically that needs permission
Author
Owner

@pawelel commented on GitHub (Dec 8, 2025):

Using opencode in Rider’s built-in terminal causes the terminal to behave incorrectly.

Steps to reproduce:
Run opencode in the Rider terminal (I’m using only the default agents).

Observed behavior:

Pressing Esc does not interrupt the “working” animation, and my messages get queued instead.

When I press Ctrl+C, the terminal switches into some kind of mouse-input mode — every mouse move prints weird characters into the terminal.

The terminal returns to normal only after closing and reopening it inside Rider.

Additional note:
This behavior occurs only with opencode. Other tools do not trigger the issue.

@pawelel commented on GitHub (Dec 8, 2025): Using opencode in Rider’s built-in terminal causes the terminal to behave incorrectly. Steps to reproduce: Run opencode in the Rider terminal (I’m using only the default agents). Observed behavior: Pressing Esc does not interrupt the “working” animation, and my messages get queued instead. When I press Ctrl+C, the terminal switches into some kind of mouse-input mode — every mouse move prints weird characters into the terminal. The terminal returns to normal only after closing and reopening it inside Rider. Additional note: This behavior occurs only with opencode. Other tools do not trigger the issue.
Author
Owner

@mossbergmaverick commented on GitHub (Dec 30, 2025):

@mossbergmaverick yeah that should work, it switches to the child session automatically that needs permission

Got it, but why doesn't it switch back to the parent session after execution? Does it mean I have to do it manually every time? This is quite inconvenient—it kind of defeats the whole purpose of working with a subagent.

@mossbergmaverick commented on GitHub (Dec 30, 2025): > [@mossbergmaverick](https://github.com/mossbergmaverick) yeah that should work, it switches to the child session automatically that needs permission Got it, but why doesn't it switch back to the parent session after execution? Does it mean I have to do it manually every time? This is quite inconvenient—it kind of defeats the whole purpose of working with a subagent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2881