Terminal command in chat is stuck in "Working" state for long running commands
Operating System
darwin
Kiro Version
0.1.0
Bug Description
Oftentimes, the tool is stuck in "Working" state. Sometimes this after a ./gradlew test, which executes the tests fine, and then after that, the tool stops. I'm currently executing one of the tasks in the tasks.md, and after 3-4 attempts, it's still not completed successfully, the tool keeps locking up.
Steps to Reproduce
I'm executing the first task in the tasks.md, and the tool never completes with the task
Expected Behavior
I would have expected the tool to complete one day, but it's just stuck, being idle. Stopping it and saying "please continue" doesn't make a change.
Conversation ID
77730ed7-92eb-4d2c-8095-ac931dc6d0f2 843b088e-c662-4cb8-b05b-2541e932aa14
Additional Context
No response
Hey, @erikpragt-connectid and thanks for opening this issue. The behavior here seems similar to what we see in #20 with how the agent chat session hangs indefinitely, stuck in that "working" state. Can you share a screenshot of the completed tests in the terminal output or validate that it's similar to when you do something like running npm run dev?
It always gets stuck for me on the second run in the same terminal. So I close the terminal each time—then the model spins up a new one to execute the next command and captures the result successfully. But if I forget to close the terminal tab, the next command always hangs.
I’m on macOS 15.5, using zsh with Powerlevel10k and a few other plugins installed. Kiro 0.1.15.
This might be related to your terminal prompt.
I was having the same problem when using powerlevel10k. I had it set up to dynamically show information about the last command ran (return code in my case). I figured out that my prompt, always changing, was interfering with Kiro's way of determining if a command had finished execution.
My solution: Try updating your prompt to something simpler.
I got rid of this issue by using the following prompt:
~ $ echo $PS1
%~ $
Good luck!
For starship.rs users: I recommend disabling starship when $TERM_PROGRAM is kiro. This allowed the chat to recognize when a command has finished and fixed this problem for me.
I realized the root cause in my case (https://github.com/kirodotdev/Kiro/issues/736#issuecomment-3085325531) was that I had byobu autostart in my shell and that made my Kiro commands hang, because it uses the same default user shell.
Also as others mentioned a heavily customized shell configuration or prompt could cause issues, so my recommendation is to simply set the sh shell profile as default in Kiro, which could eliminate a lot of problems. It worked for me.
One more slightly related issue: when Kiro tries to see current working directory changes by running git diff it can also get stuck indefinitely if the pager is set to something interactive (where you have to manually scroll to the end of the output). If Kiro issued git --no-pager diff or GIT_PAGER=cat git diff this would not be a problem.
Essentially I think Kiro should only issue non-interactive commands.
I have this issue, as well.
When executing tasks requires running Python scripts in the terminal, Kiro frequently runs commands like:
uv run python -c "<long_python_script>"
In this case, the python script execution often hangs, with the shell session "disconnected" (with a red icon suggested something is disconnected besides the kiro terminal title). After that, no more shell sessions can be successfully started, unless the Kiro App is reloaded.
👍 to this. Having the same issue. Everything was smooth until the task/execution phase of the spec development. Then it became clunky fast. Sometimes it recognizes the command has exited, other times it does not. At first I thought it was my shell customization, but it seems others are reporting this problem too.
For me, the first command per 'turn' runs fine, the second command keeps waiting forever. I need to click on cancel and paste in the command output myself.
Jumping back to the 16 July release it is better but will still flakes out sometimes. I found if delete all the shell windows between each command it has a much higher chance of not getting stuck.
@cwomack
this issue. The behavior here seems similar to what we see in #20 with how the agent chat session hangs indefinitely, stuck in that "working" state. Can you share a screenshot of the completed tests in the terminal output or validate that it's similar to when you
I've been facing similar issue as seen in the screenshot
I asked Kiro to fetch a commit from git logs, it ran the command git log --oneline --grep="vs code" -i , now in the terminal it ran successfully, but did not exit as shown in the image. Now my chat is stuck unless I ask it to stop.
Discord thread: here
@joobisb according to your screenshot the issue is caused by Kiro running interactive commands that you need to terminate. Try hitting q and see if Kiro realizes the command has exited.
(This should work for most issues people report in comments here.)
Also again: set sh as your default Kiro shell so heavy shell customizations do not interfere with the command output processing of Kiro.
Check if you have oh my bash. Kiro started to work once i removed it
@joobisb according to your screenshot the issue is caused by Kiro running interactive commands that you need to terminate. Try hitting
qand see if Kiro realizes the command has exited.(This should work for most issues people report in comments here.)
Also again: set
shas your default Kiro shell so heavy shell customizations do not interfere with the command output processing of Kiro.
@Semmu
It did exit the interactive shell manually, but Kiro didn't realze it was exited.
My default shell is oh-my-zsh. In other platforms like claude-code and cursor, this default configuration doesn't seem to cause any issues.
I've set default profile to bash and it seems to make Kiro happy.
I also use oh-my-zsh with some fancy extensions and multi-line prompt template. Not sure it it broke terminal integration on Kiro level or on underlying VS Code level
@dmay's solution works for me, I changed my default profile to bash from my oh-my-zsh config. Seems like there is an issue with custom prompts in oh-my-zsh and similar customisations.
can some one please share workarounds or a confirmation whether Kiro team is planning to fix it? this has become a blocker for a critical project I am working. I am having second thoughts of abandoning the IDE due to these strange issues and support
@softwaredementor This is a preview release. It is not meant to be production ready, I would never use it as such. If you need a production level too, then use Amazon Q for Developers.
@softwaredementor for tests, I write the results into a file (say, /test-results/[time]-results.log) and then direct Kiro to read form it. It worked fine.
@softwaredementor have you tried any of the recommended workarounds for your "critical project"?
@softwaredementor have you tried any of the recommended workarounds for your "critical project"?
Hi @Semmu as suggested above, I've now switched my IDE for production related tasks. I don't see documented workaround for this problem. However, i tried attempting a workaround in my logged bug https://github.com/kirodotdev/Kiro/issues/1659.
The workaround was ``I encoutered a similar issue. Kiro stuck, and no respond what so ever. No "working" prompt or any response in the Kiro Chat window. Setup: Window 10, Kiro v0.1.25, remote to Ubuntu server.
If I remembered correctly, my solution was removing the remote server folder ~/.kiro-server/data/User/globalStorage/kiro.kiroagent Kiro Agent will become dumb after the folder is removed, but it recovers after a day of use.
I work on a mono repo, so I didn't try open a new project. `` This was not applicable to me as i wasn't doing any remote server connection. Didn't apply for my issue