Skip to content

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

Closed

Description

@JosXa

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 28, 2025
  2. github-actions commented on Nov 28, 2025

    @github-actions
    Contributor

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

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

  3. rekram1-node commented on Nov 28, 2025

    @rekram1-node
    Contributor

    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

  4. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 28, 2025
  5. self-assigned this
    on Nov 28, 2025
  6. JosXa commented on Nov 28, 2025

    @JosXa
    ContributorAuthor

    This should prove it?

    Image

    https://opencode.ai/s/HklH4yiK

  7. rekram1-node commented on Nov 28, 2025

    @rekram1-node
    Contributor

    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

  8. rekram1-node commented on Nov 28, 2025

    @rekram1-node
    Contributor

    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

  9. JosXa commented on Nov 28, 2025

    @JosXa
    ContributorAuthor

    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.

  10. rekram1-node commented on Nov 28, 2025

    @rekram1-node
    Contributor

    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

  11. JosXa commented on Nov 28, 2025

    @JosXa
    ContributorAuthor

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

  12. JosXa commented on Nov 29, 2025

    @JosXa
    ContributorAuthor

    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?

  13. rekram1-node commented on Nov 29, 2025

    @rekram1-node
    Contributor

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

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