Skip to content

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

Closed as not planned

Description

@mossbergmaverick

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 15, 2025
  2. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 15, 2025
  3. mossbergmaverick commented on Nov 15, 2025

    @mossbergmaverick
    Author

    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.

  4. rekram1-node commented on Nov 16, 2025

    @rekram1-node
    Contributor
    Image

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

    Was this specifically with a subagent?

  5. mossbergmaverick commented on Nov 16, 2025

    @mossbergmaverick
    Author

    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.

  6. rekram1-node commented on Nov 17, 2025

    @rekram1-node
    Contributor

    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

  7. pawelel commented on Nov 20, 2025

    @pawelel

    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.

  8. rekram1-node commented on Nov 21, 2025

    @rekram1-node
    Contributor

    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

  9. pawelel commented on Nov 28, 2025

    @pawelel

    Image There is nothing I can do except CTRL C.

  10. mossbergmaverick commented on Dec 1, 2025

    @mossbergmaverick
    Author

    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?

  11. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Contributor

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

  12. pawelel commented on Dec 8, 2025

    @pawelel

    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.

  13. mossbergmaverick commented on Dec 31, 2025

    @mossbergmaverick
    Author

    @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.

  14. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  15. removed
    bugSomething isn't working
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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