Skip to content

Bug: Interrupt does not work as expected #2494

Closed

Description

@nikhilmaddirala

Here's a simplified version of what happened in this example: https://opencode.ai/s/KWIabDZ8

  • I ask question 1
  • Opencode starts responding to question 1
  • I interrupt by hitting Esc twice
  • I ask question 2
  • Opencode responds to question 1 (it doesn't seem to register question 2)
  • I interrupt and ask question 2 again
  • Opencode still responds to question 1
  • ...

Activity

  1. github-actions commented on Sep 8, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. self-assigned this
    on Sep 8, 2025
  3. rekram1-node commented on Sep 8, 2025

    @rekram1-node
    Collaborator

    thanks for raising this, I will take a look

  4. rekram1-node commented on Sep 10, 2025

    @rekram1-node
    Collaborator

    Looking at the thinking block it seems like a grok code fluke maybe, it kinda confused itself:

    The user message is: "@general who are youUse the above message and context to generate a prompt and call the task tool with subagent: general
    
    Interpreting user queries
    The user has asked "who are you" directed at "@general," suggesting a request for information about this entity.
    Another query, "who are you" directed at "@tyrion," indicates a similar request for details about that entity.
    Both queries seem to seek identification or background information, likely expecting a description of roles or identities.
    Preparing response approach
    Need to generate prompts based on the user’s messages to address each query separately.
    The prompts will involve calling a task tool with a subagent, likely "general" for the first and "tyrion" for the second.
    Aim is to ensure responses are tailored to each entity while maintaining clarity and relevance.
    Preparing response approach
    The task involves generating prompts for "@general who are you" and "@tyrion who are you," each calling the task tool with their respective subagents.
    

    so the llm definitely got both questions

  5. nikhilmaddirala commented on Sep 10, 2025

    @nikhilmaddirala
    Author

    @rekram1-node

    so the llm definitely got both questions

    In addition to both questions, the llm needs to get some message indicating "the user canceled the first question and then asked the second question" else it's bound to get confused by looking at two separate questions.

  6. rekram1-node commented on Sep 10, 2025

    @rekram1-node
    Collaborator

    Yeah that makes sense

  7. rekram1-node commented on Sep 18, 2025

    @rekram1-node
    Collaborator

    We made some tweaks for interruptions I think this should be addressed a lot better now, but if it continues happening lmk and we can adjust

  8. westykid commented on Oct 24, 2025

    @westykid

    it continues... looking at #888 I wonder if this is an linux-specific thing too?

    I use opencode (0.15.14) in a VM running Ubuntu 22.04 on a Mac Sonama host.

    I have never got any model to stop on double (or multiple) esc presses. I normally use Grok 4 Fast. But I have tried with many different models via many different providers.

  9. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Collaborator

    is it registering the key press at all? does it say anything indicating that it was captured

  10. westykid commented on Oct 24, 2025

    @westykid

    Yes it does - I get 'esc again' flash up (bottom left notice) - but nothing happens after second press except message disappearing - the same cycle of two esc key presses can be repeated with IMO no UI errors... it just won't stop what it's doing... without a force quit...

  11. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Collaborator

    that’s weird hmm never seen that happen

    i cant replicate either :/

    can u show logs for it by chance?

  12. westykid commented on Oct 24, 2025

    @westykid

    Yes - but from where do I get those? I'll take a video of it too if you like but tomorrow...

  13. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Collaborator

    awesome thanks!

    ~/.local/share/opencode/log/….

    ^ they are by timestamp so ideally u start a new opencode instance then do the double esc mid session then close and copy latest log file

  14. westykid commented on Oct 24, 2025

    @westykid

    I think I may have identified an issue that is due to my system not opencode - let me do some more testing first to confirm scenarios but I have just tried a new session (with Grok 4 Fast) and for the first time (that I've seen) I got 'Request was aborted'... exactly the expected behaviour... (I have 7 opencode instances running at once - some through PTY - all with different model/provider combinations ... and a custom WIP MCP cluster ... get's a bit tricky to binary chop issues... )

  15. westykid commented on Oct 24, 2025

    @westykid

    Happy days @rekram1-node ... I was getting confused and testing in a wrong instance - one that lived in PTY - therefore contaminating the SUT - I used opencode to help fix it 👍

    Root Cause: Buffer-to-string conversion in stdin forwarding was altering timing and byte boundaries, breaking double-ESC detection.

    ... which would have taken me days to figure out.

    Tested a few times (3) and got an abort every time.

    So - my bad... apologies... but thank you for being so very, very proactive 🖖🏻

  16. rekram1-node commented on Oct 24, 2025

    @rekram1-node
    Collaborator

    Yeah no probs glad we got it figured out

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