working getting stuck and double esc not exiting #985

Open
opened 2026-02-16 17:29:00 -05:00 by yindo · 10 comments
Owner

Originally created by @willleeney on GitHub (Jul 30, 2025).

Originally assigned to: @thdxr on GitHub.

Im using opencode inside a zed terminal. sometimes opencode just gets stuck on working and doesn't output any steps that it is doing anything but when I try and hit escape twice to exit nothing happens.

Originally created by @willleeney on GitHub (Jul 30, 2025). Originally assigned to: @thdxr on GitHub. Im using opencode inside a zed terminal. sometimes opencode just gets stuck on working and doesn't output any steps that it is doing anything but when I try and hit escape twice to exit nothing happens.
Author
Owner

@cpursley commented on GitHub (Jul 30, 2025):

It's also getting stuck for failed file uploads and there's no way to get out/move on.

@cpursley commented on GitHub (Jul 30, 2025): It's also getting stuck for failed file uploads and there's no way to get out/move on.
Author
Owner

@adamdotdevin commented on GitHub (Jul 31, 2025):

i believe dax fixed this yesterday, can someone confirm in latest?

@adamdotdevin commented on GitHub (Jul 31, 2025): i believe dax fixed this yesterday, can someone confirm in latest?
Author
Owner

@anschmieg commented on GitHub (Aug 5, 2025):

For me, this regularly happens when opencode is executing bash commands. Neither Esc; Esc nor Ctrl + C; Ctrl + C --> opencode --> /sessions --> (select and Enter) can solve this.

@anschmieg commented on GitHub (Aug 5, 2025): For me, this regularly happens when opencode is executing bash commands. Neither `Esc; Esc` nor `Ctrl + C; Ctrl + C` --> `opencode` --> `/sessions` --> (select and `Enter`) can solve this.
Author
Owner

@thdxr commented on GitHub (Aug 5, 2025):

is it any bash command? or specific ones

@thdxr commented on GitHub (Aug 5, 2025): is it any bash command? or specific ones
Author
Owner

@anschmieg commented on GitHub (Aug 5, 2025):

@thdxr I'm not quite sure. I suspected it might be python or curl commands, but prompts that lead to:

Bash Runs a simple mathematical calculation in Python
$ python -c "print(2 * (3 + 4) / 5)"

and

Bash Import openai_server.py and list its objects
$ python -c "import sys; sys.path.insert(0, 'server'); import openai_server; print(dir(openai_server))"

return valid outputs, while

Bash Run the server and test /health and /v1/models endpoints
$ python server/openai_server.py & sleep 5; curl -s http://localhost:6060/health; curl -s http://localhost:6060/v1/models

does not. It continues to show working… and hitting Esc only toggles between "esc interrupt" and "esc again interrupt". Even when quitting opencode with ^C, the process is still running after the TUI already quit, and has be be terminated with ^C again. Screenshot attached.

Let me know if you need any further info or if I can run any tests.

Image
@anschmieg commented on GitHub (Aug 5, 2025): @thdxr I'm not quite sure. I suspected it might be python or curl commands, but prompts that lead to: > Bash Runs a simple mathematical calculation in Python > $ python -c "print(2 * (3 + 4) / 5)" and > _Bash Import openai_server.py and list its objects_ > `$ python -c "import sys; sys.path.insert(0, 'server'); import openai_server; print(dir(openai_server))"` return valid outputs, while > Bash Run the server and test /health and /v1/models endpoints > $ python server/openai_server.py & sleep 5; curl -s http://localhost:6060/health; curl -s http://localhost:6060/v1/models does not. It continues to show `working…` and hitting `Esc` only toggles between "**esc** interrupt" and "**esc again** interrupt". Even when quitting opencode with `^C`, the process is still running after the TUI already quit, and has be be terminated with `^C` again. Screenshot attached. Let me know if you need any further info or if I can run any tests. <img width="1768" height="632" alt="Image" src="https://github.com/user-attachments/assets/5314d671-aa15-4a80-8463-25fe60a319c2" />
Author
Owner

@ezra-en commented on GitHub (Aug 6, 2025):

I'm using opencode via Windows Terminal and am experiencing the same issue, except it's on every prompt. Still occurs as of v0.3.131. Sending a new message seems to resolve it though.

@ezra-en commented on GitHub (Aug 6, 2025): I'm using opencode via Windows Terminal and am experiencing the same issue, except it's on every prompt. Still occurs as of v0.3.131. Sending a new message seems to resolve it though.
Author
Owner

@MisterBiggs commented on GitHub (Aug 7, 2025):

Seeing the same issue but it gets jammed up immediately on a prompt, and outside of the TUI mode when just doing opencode run "test". Happens with Antropic API key, and with local ollama model. On Opencode versions 0.3.133 and 0.2.28. No errors in the logs. Ubuntu 22.04, ghostty terminal and built-in terminal

`opencode run "test" --print-logs` output
INFO  2025-08-07T21:13:23 +58ms service=app cwd=/home/anson creating
INFO  2025-08-07T21:13:23 +0ms service=default version=0.2.28 args=run,test,--print-logs opencode
INFO  2025-08-07T21:13:23 +0ms service=app cwd=/home/anson creating
INFO  2025-08-07T21:13:23 +3ms service=app git=/home/anson git
INFO  2025-08-07T21:13:23 +0ms service=app git=/home/anson git
INFO  2025-08-07T21:13:23 +1ms service=app name=config registering service
INFO  2025-08-07T21:13:23 +1ms service=bus type=storage.write subscribing
INFO  2025-08-07T21:13:23 +0ms service=app name=bus registering service
INFO  2025-08-07T21:13:23 +0ms service=format init
INFO  2025-08-07T21:13:23 +0ms service=bus type=file.edited subscribing
INFO  2025-08-07T21:13:23 +0ms service=config.hooks init
INFO  2025-08-07T21:13:23 +0ms service=bus type=file.edited subscribing
INFO  2025-08-07T21:13:23 +0ms service=bus type=session.idle subscribing
INFO  2025-08-07T21:13:23 +0ms service=app name=lsp registering service
INFO  2025-08-07T21:13:23 +0ms service=session id=ses_7799e589affen90KdplGFEATdJ version=0.2.28 title=New Session - 2025-08-07T21:13:23.557Z time=[object Object] created
INFO  2025-08-07T21:13:23 +0ms service=app name=session registering service
INFO  2025-08-07T21:13:23 +0ms service=app name=storage registering service
INFO  2025-08-07T21:13:23 +2ms service=config loaded
INFO  2025-08-07T21:13:23 +0ms service=bus type=storage.write publishing
INFO  2025-08-07T21:13:23 +0ms service=app name=config registering service
INFO  2025-08-07T21:13:23 +0ms service=config loaded
INFO  2025-08-07T21:13:23 +0ms service=bus type=session.updated publishing

█▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀
█░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀
▀▀▀▀ █▀▀▀ ▀▀▀ ▀  ▀ ▀▀▀ ▀▀▀▀ ▀▀▀  ▀▀▀

>  test

INFO  2025-08-07T21:13:23 +0ms service=app name=provider registering service
INFO  2025-08-07T21:13:23 +3ms service=models.dev refreshing
INFO  2025-08-07T21:13:23 +0ms service=provider init
INFO  2025-08-07T21:13:23 +2ms service=provider providerID=anthropic found
@  anthropic/claude-sonnet-4-20250514

INFO  2025-08-07T21:13:23 +0ms service=bus type=message.part.updated subscribing
INFO  2025-08-07T21:13:23 +0ms service=bus type=session.error subscribing
INFO  2025-08-07T21:13:23 +0ms service=app name=mode registering service
INFO  2025-08-07T21:13:23 +2ms service=session session=ses_7799e589affen90KdplGFEATdJ chatting
INFO  2025-08-07T21:13:23 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 getModel
INFO  2025-08-07T21:13:23 +0ms service=provider status=started providerID=anthropic getSDK
INFO  2025-08-07T21:13:23 +54ms service=provider status=completed duration=54 providerID=anthropic getSDK
INFO  2025-08-07T21:13:23 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 found
INFO  2025-08-07T21:13:23 +3ms service=session session=ses_7799e589affen90KdplGFEATdJ sessionID=ses_7799e589affen90KdplGFEATdJ locking
INFO  2025-08-07T21:13:23 +6ms service=bus type=storage.write publishing
INFO  2025-08-07T21:13:23 +0ms service=bus type=message.updated publishing

Then hangs and nothing happens

@MisterBiggs commented on GitHub (Aug 7, 2025): Seeing the same issue but it gets jammed up immediately on a prompt, and outside of the TUI mode when just doing `opencode run "test"`. Happens with Antropic API key, and with local ollama model. On Opencode versions 0.3.133 and 0.2.28. No errors in the logs. Ubuntu 22.04, ghostty terminal and built-in terminal <details> <summary>`opencode run "test" --print-logs` output</summary> ```bash INFO 2025-08-07T21:13:23 +58ms service=app cwd=/home/anson creating INFO 2025-08-07T21:13:23 +0ms service=default version=0.2.28 args=run,test,--print-logs opencode INFO 2025-08-07T21:13:23 +0ms service=app cwd=/home/anson creating INFO 2025-08-07T21:13:23 +3ms service=app git=/home/anson git INFO 2025-08-07T21:13:23 +0ms service=app git=/home/anson git INFO 2025-08-07T21:13:23 +1ms service=app name=config registering service INFO 2025-08-07T21:13:23 +1ms service=bus type=storage.write subscribing INFO 2025-08-07T21:13:23 +0ms service=app name=bus registering service INFO 2025-08-07T21:13:23 +0ms service=format init INFO 2025-08-07T21:13:23 +0ms service=bus type=file.edited subscribing INFO 2025-08-07T21:13:23 +0ms service=config.hooks init INFO 2025-08-07T21:13:23 +0ms service=bus type=file.edited subscribing INFO 2025-08-07T21:13:23 +0ms service=bus type=session.idle subscribing INFO 2025-08-07T21:13:23 +0ms service=app name=lsp registering service INFO 2025-08-07T21:13:23 +0ms service=session id=ses_7799e589affen90KdplGFEATdJ version=0.2.28 title=New Session - 2025-08-07T21:13:23.557Z time=[object Object] created INFO 2025-08-07T21:13:23 +0ms service=app name=session registering service INFO 2025-08-07T21:13:23 +0ms service=app name=storage registering service INFO 2025-08-07T21:13:23 +2ms service=config loaded INFO 2025-08-07T21:13:23 +0ms service=bus type=storage.write publishing INFO 2025-08-07T21:13:23 +0ms service=app name=config registering service INFO 2025-08-07T21:13:23 +0ms service=config loaded INFO 2025-08-07T21:13:23 +0ms service=bus type=session.updated publishing █▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀ █░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀ > test INFO 2025-08-07T21:13:23 +0ms service=app name=provider registering service INFO 2025-08-07T21:13:23 +3ms service=models.dev refreshing INFO 2025-08-07T21:13:23 +0ms service=provider init INFO 2025-08-07T21:13:23 +2ms service=provider providerID=anthropic found @ anthropic/claude-sonnet-4-20250514 INFO 2025-08-07T21:13:23 +0ms service=bus type=message.part.updated subscribing INFO 2025-08-07T21:13:23 +0ms service=bus type=session.error subscribing INFO 2025-08-07T21:13:23 +0ms service=app name=mode registering service INFO 2025-08-07T21:13:23 +2ms service=session session=ses_7799e589affen90KdplGFEATdJ chatting INFO 2025-08-07T21:13:23 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 getModel INFO 2025-08-07T21:13:23 +0ms service=provider status=started providerID=anthropic getSDK INFO 2025-08-07T21:13:23 +54ms service=provider status=completed duration=54 providerID=anthropic getSDK INFO 2025-08-07T21:13:23 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 found INFO 2025-08-07T21:13:23 +3ms service=session session=ses_7799e589affen90KdplGFEATdJ sessionID=ses_7799e589affen90KdplGFEATdJ locking INFO 2025-08-07T21:13:23 +6ms service=bus type=storage.write publishing INFO 2025-08-07T21:13:23 +0ms service=bus type=message.updated publishing ``` Then hangs and nothing happens </details>
Author
Owner

@dBianchii commented on GitHub (Aug 18, 2025):

happening with me. it says "working..." and doesn't output anything and hangs forever

@dBianchii commented on GitHub (Aug 18, 2025): happening with me. it says "working..." and doesn't output anything and hangs forever
Author
Owner

@devhe4d commented on GitHub (Aug 20, 2025):

same issue here

@devhe4d commented on GitHub (Aug 20, 2025): same issue here
Author
Owner

@adolfousier commented on GitHub (Oct 8, 2025):

Same issue here, I could not cancel, stop 'generating' tasks and even when I can stop them which is when its not 'generating' this brings a terrible user experience 1000%. It's so frustrating we can't stop whenever we want and on top of that the costs to the company increase as it keeps generating without user intent. And sometimes it slows down ad keep writing forever like minutes literally and you can't do anything but ctrl c and exit application. I'm working on a patch to this, would love to contribute with this project as I use extensively on daily basis. If streaming/generating, it should 'stop/kill' stream.

@adolfousier commented on GitHub (Oct 8, 2025): Same issue here, I could not cancel, stop 'generating' tasks and even when I can stop them which is when its not 'generating' this brings a terrible user experience 1000%. It's so frustrating we can't stop whenever we want and on top of that the costs to the company increase as it keeps generating without user intent. And sometimes it slows down ad keep writing forever like minutes literally and you can't do anything but ctrl c and exit application. I'm working on a patch to this, would love to contribute with this project as I use extensively on daily basis. If streaming/generating, it should 'stop/kill' stream.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#985