opencode icon indicating copy to clipboard operation
opencode copied to clipboard

When model uses edit tool it returns status 126

Open DiedeClaessens opened this issue 1 year ago • 15 comments

When the model wants to edit my files it returns status 136. But the actual file is edited.  Image

DiedeClaessens avatar Jul 17 '25 09:07 DiedeClaessens

what model is this?

thdxr avatar Jul 17 '25 18:07 thdxr

oh this maybe is related to a formatter? what kind of file is this

thdxr avatar Jul 17 '25 18:07 thdxr

Elixir and does not matter what model I use, they all have it

DiedeClaessens avatar Jul 18 '25 10:07 DiedeClaessens

@thdxr sorry to bother you again but could you maybe give me some guidance how to fix. Could not find it in the docs?

DiedeClaessens avatar Jul 24 '25 06:07 DiedeClaessens

I'm having this same issue.

objectuser avatar Aug 20 '25 20:08 objectuser

@objectuser are you only having it w/ elixir?

rekram1-node avatar Aug 20 '25 20:08 rekram1-node

@objectuser are you only having it w/ elixir?

It is with Elixir and yes only with Elixir but that's also only how I'm using it.

I'm suspicious that it's asdf.

Really new to opencode but found:

ERROR 2025-08-20T13:41:37 +324ms service=default e=Failed with exit code 126 rejection

But also:

INFO 2025-08-20T13:56:06 +0ms service=format command=["mix","format","$FILE"] running

No errors around ☝️ . 🤔

objectuser avatar Aug 20 '25 20:08 objectuser

sweet, I will try to fix this for ya when I get a second later tonight

rekram1-node avatar Aug 20 '25 21:08 rekram1-node

🍻

objectuser avatar Aug 20 '25 21:08 objectuser

@objectuser looking into this more I think it is probably something specific to you? not sure if there is anything for us to do on our end maybe formatters shouldn't send errors to context but idk what else?

rekram1-node avatar Aug 22 '25 19:08 rekram1-node

OK thanks, @rekram1-node. I wonder if everyone using Elixir is getting the same error. opencode is completing Elixir tasks (code modifications, etc.) successfully.

I'll continue to look around, maybe ask in some Elixir venues.

objectuser avatar Aug 22 '25 19:08 objectuser

i could be mistaken here btw, just out of curiosity what is your mix path? like where is it located, does it require something custom from your .zshrc or something to get loaded properly?

we are running the mix … command but we arent sourcing your zshrc etc, but if mix is resolved through PATH properly it shouldnt be an issue

rekram1-node avatar Aug 23 '25 13:08 rekram1-node

I'm using mix through asdf which is in my path.

I just found out I get improved results when I disable elixir-ls.

  "lsp": {
    "elixir-ls": {
      "disabled": true
    }
  },

No error is generated and for the first time I see a diff of the edits.

objectuser avatar Aug 23 '25 13:08 objectuser

ahh elixir lsp separate issue that makes more sense, for some reason I was thinking formatter

rekram1-node avatar Aug 25 '25 19:08 rekram1-node

haven't seen activity on this one in a while closing unless more people have this issue

rekram1-node avatar Sep 22 '25 18:09 rekram1-node