ShellFailed with exit code 1 when OpenCode tries to "ask" for permissions (Windows) #3193

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

Originally created by @JosXa on GitHub (Nov 28, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Any tool call that is configured as "ask" fails with ShellFailed with exit code 1.

Image

OpenCode version

1.0.119

Steps to reproduce

  1. Set permission of any tool to "ask" or rely on default for external_directory (=ask)
  2. Perform that tool call
  3. Observe it fail

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @JosXa on GitHub (Nov 28, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Any tool call that is configured as "ask" fails with `ShellFailed with exit code 1`. <img width="733" height="86" alt="Image" src="https://github.com/user-attachments/assets/fb3de49c-7d05-4680-86db-dca8c5d25165" /> ### OpenCode version 1.0.119 ### Steps to reproduce 1. Set permission of any tool to "ask" or rely on default for `external_directory` (=ask) 2. Perform that tool call 3. Observe it fail ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
Author
Owner

@github-actions[bot] commented on GitHub (Nov 28, 2025):

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

  • #3763: [Windows] interactive call breaking tui - describes Windows terminal issues with interactive bash calls that expect user input, similar to the permission asking flow

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Nov 28, 2025): This issue might be a duplicate of existing issues. Please check: - #3763: [Windows] interactive call breaking tui - describes Windows terminal issues with interactive bash calls that expect user input, similar to the permission asking flow Feel free to ignore if this doesn't address your specific case.
Author
Owner

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

Isn't this an OS level permission. Not an opencode bug? Seems like opencode the executable on your machine doesnt have permission to read that file at all.

So you'd need to edit your actual settings at a lower level than opencode settings

@rekram1-node commented on GitHub (Nov 28, 2025): Isn't this an OS level permission. Not an opencode bug? Seems like opencode the executable on your machine doesnt have permission to read that file at all. So you'd need to edit your actual settings at a lower level than opencode settings
Author
Owner

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

This should prove it?

Image

https://opencode.ai/s/HklH4yiK

@JosXa commented on GitHub (Nov 28, 2025): This should prove it? <img width="577" height="395" alt="Image" src="https://github.com/user-attachments/assets/ab05c461-94df-432d-986e-fa0390211cdf" /> https://opencode.ai/s/HklH4yiK
Author
Owner

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

But like I said, if you are getting errors when opencode tries to execute things or read files. Thats at your OS level, it doesnt really matter the permission in the config if your os is rejecting it right

@rekram1-node commented on GitHub (Nov 28, 2025): But like I said, if you are getting errors when opencode tries to execute things or read files. Thats at your OS level, it doesnt really matter the permission in the config if your os is rejecting it right
Author
Owner

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

What do you see if you try to do:

type "!" into prompt input box to go into shell mode

then type "git status"

Then hit enter

@rekram1-node commented on GitHub (Nov 28, 2025): What do you see if you try to do: type "!" into prompt input box to go into shell mode then type "git status" Then hit enter
Author
Owner

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

Oh, so you're saying the "ask" just runs some shell script to prompt for confirmation?
Bear in mind that I have no idea what it's supposed to look like since it never worked.

Neither has ! command, but that might indeed be on me:

 $ git status                                                                         ┃Microsoft Windows [Version 10.0.26220.7271]     
┃  (c) Microsoft Corporation. All rights           
┃  reserved.                                       
┃  Not enough memory resources are available       
┃  to process this command.                        
┃

Getting this despite having set $SHELL to pwsh.exe, so no idea what's going on. Will try to debug. Obviously not getting this error anywhere else.

@JosXa commented on GitHub (Nov 28, 2025): Oh, so you're saying the "ask" just runs some shell script to prompt for confirmation? Bear in mind that I have no idea what it's supposed to look like since it never worked. Neither has `! command`, but that might indeed be on me: ``` $ git status ┃Microsoft Windows [Version 10.0.26220.7271] ┃ (c) Microsoft Corporation. All rights ┃ reserved. ┃ Not enough memory resources are available ┃ to process this command. ┃ ``` Getting this despite having set $SHELL to pwsh.exe, so no idea what's going on. Will try to debug. Obviously not getting this error anywhere else.
Author
Owner

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

Oh, so you're saying the "ask" just runs some shell script to prompt for confirmation?
Bear in mind that I have no idea what it's supposed to look like since it never worked.

No im saying that "ask" will force the user to approve things before they are ran. However the errors you are getting have nothing to do with opencode permissions and everything to do with your OS and your setup.

I guess here the issue is you dont have enough RAM

@rekram1-node commented on GitHub (Nov 28, 2025): > Oh, so you're saying the "ask" just runs some shell script to prompt for confirmation? Bear in mind that I have no idea what it's supposed to look like since it never worked. No im saying that "ask" will force the user to approve things before they are ran. However the errors you are getting have nothing to do with opencode permissions and everything to do with your OS and your setup. I guess here the issue is you dont have enough RAM
Author
Owner

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

Heh yeah if only it was that easy, got a cool 40GB left over :(

@JosXa commented on GitHub (Nov 28, 2025): Heh yeah if only it was that easy, got a cool 40GB left over :(
Author
Owner

@JosXa commented on GitHub (Nov 29, 2025):

Interestingly, I'm hitting the exact same issue on a newly installed Linux machine now, where ! command works fine. I don't see how my config could possibly be causing this. Would it help if I gave some additional context from there?

@JosXa commented on GitHub (Nov 29, 2025): Interestingly, I'm hitting the exact same issue on a newly installed Linux machine now, where `! command` works fine. I don't see how my config could possibly be causing this. Would it help if I gave some additional context from there?
Author
Owner

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

I mean probably? It doesn't seem like it has anything to do with your opencode config to me

@rekram1-node commented on GitHub (Nov 29, 2025): I mean probably? It doesn't seem like it has anything to do with your opencode config to me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3193