opencode icon indicating copy to clipboard operation
opencode copied to clipboard

`Failed to parse the text response` with github workflow

Open alexaka1 opened this issue 1 year ago • 22 comments

Maybe I have skill issues, but opencode is not working with its GitHub integration. I have set it up but it's not able to summarize PRs.

Eg. see this run: https://github.com/alexaka1/distroless-dotnet-healthchecks/actions/runs/17205772206/job/48805971861

https://github.com/alexaka1/distroless-dotnet-healthchecks/pull/672#issuecomment-3219642869

https://github.com/alexaka1/distroless-dotnet-healthchecks/blob/fddeddd27a44965b3ee634b2928ac0e1bd1f80af/.github/workflows/opencode.yml

alexaka1 avatar Aug 25 '25 10:08 alexaka1

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

  • #2188: Similar JSON parsing failure with "JSON parsing failed: Text" error
  • #2135: Similar parsing error with "UnknownError: Failed to parse" that makes sessions unusable
  • #1818: GitHub action failures related to version fetching and setup issues
  • #1417: GitHub Integration issues where the workflow runs but doesn't work as expected

The core issue appears to be related to text/JSON parsing failures in the GitHub workflow context. Issues #2188 and #2135 specifically deal with similar parsing errors that could be related to your "Failed to parse the text response" error.

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Aug 25 '25 10:08 github-actions[bot]

Just adding that I'm seeing the same thing - can't share the run as it's on a private repo, but exactly the same error message at the same point in the process. Config is the same as above, except we are using google/gemini-2.5-flash as a model.

I do seem to be able to run "summarise this pr" style tasks fine, but if I ask opencode to actually work on an issue it fails with the "Failed to parse the text response" error every time.

Could definitely be a setup issue, but there isn't much context in the logs so I'm not really sure

danielbollomsend avatar Aug 26 '25 23:08 danielbollomsend

Same thing happening here. Just configured the repo with opencode github install, exactly as the documentation says.

I also can’t share because the repo is private, but we're using github-copilot/claude-3.7-sonnet-thought, and anything works, from issues to PRs.

mateus-ito avatar Aug 28 '25 03:08 mateus-ito

Yup same issue here.

bobysf12 avatar Aug 28 '25 08:08 bobysf12

Same issue here. Did you find a solution?

Antonet99 avatar Aug 28 '25 10:08 Antonet99

looking into this

anyone has share turned on? can you send me a share link to the failed run?

fwang avatar Aug 28 '25 10:08 fwang

Eg.

https://github.com/alexaka1/distroless-dotnet-healthchecks/pull/672#issuecomment-3219642869

https://github.com/alexaka1/distroless-dotnet-healthchecks/issues/695#issuecomment-3233022309

alexaka1 avatar Aug 28 '25 11:08 alexaka1

@alexaka1 oh nice.. if u can keep them around.. i'll dig into it later today

fwang avatar Aug 28 '25 11:08 fwang

I don't know if or when they expire. I followed the default as closely as possible, and I don't intend to delete them. So hopefully they'll be there.

alexaka1 avatar Aug 28 '25 11:08 alexaka1

I was scraping github (by hand) for other repos that use this action, and I managed to find one that ran into the same issue. I will look for more

https://github.com/deadronos/SpaceAutoBattler/pull/57#issuecomment-3238767137

alexaka1 avatar Sep 01 '25 16:09 alexaka1

Without changing anything meaningful, it randomly worked for an issue comment. https://github.com/alexaka1/distroless-dotnet-healthchecks/issues/743#issuecomment-3258947259

But then immediately did not work for a PR. https://github.com/alexaka1/distroless-dotnet-healthchecks/pull/741#issuecomment-3263616053

(I thought maybe pinning to the cli tags instead of the action tags would work, but only after I realized the action downloads the latest opencode anyway, so this cannot affect anything)

alexaka1 avatar Sep 07 '25 09:09 alexaka1

@fwang, have you had a chance to look at this? What can I do to help? I keep trying the workflow from time to time, but I still get the same error.

alexaka1 avatar Sep 21 '25 18:09 alexaka1

I'm still having the same issues and have no clue what I'm doing wrong. Would appreciate some guidance on how I can help resolve this. Although I am kinda giving up on opencode-github as it has not worked 99.999% of the time since opening this issue 🙁

alexaka1 avatar Oct 19 '25 18:10 alexaka1

ill take a look today

rekram1-node avatar Oct 19 '25 20:10 rekram1-node

@alexaka1 is this the action is question? https://github.com/alexaka1/distroless-dotnet-healthchecks/blob/main/.github/workflows/opencode.yml

Github copilot is oauth only isn't it? You won't be able to use it in a github action easily right now. I read that there are some hacks to do that but opencode doesn't support those rn.

I could be totally wrong about oauth only but im fairly sure that is the case and for PAT you can only manage github copilot access / settings not actually interact with it

If you updated your config to use basically any other provider it should work

You could even use a free model (free for now):

  • opencode/code-supernova
  • opencode/grok-code

Also i'd recommend updating the action to point at latest because it got updated recently

rekram1-node avatar Oct 19 '25 21:10 rekram1-node

I remember trying an OpenAI api key too and that also didn't work. But I'll try again. https://github.com/alexaka1/distroless-dotnet-healthchecks/commit/e985c2f83a0fad5347d5acdb0bf3a8a86152d9d3

alexaka1 avatar Oct 20 '25 07:10 alexaka1

@rekram1-node Sadly, exact same issue with openai provider. https://github.com/alexaka1/distroless-dotnet-healthchecks/pull/862#issuecomment-3420942013
https://github.com/alexaka1/distroless-dotnet-healthchecks/actions/runs/18645688008/job/53152394424
https://github.com/alexaka1/distroless-dotnet-healthchecks/blob/cb8cd71c587903aea08bc0b74a45874ab22cba16/.github/workflows/opencode.yml#L28-L34

alexaka1 avatar Oct 20 '25 07:10 alexaka1

@alexaka1 mind updating your action to point at latest?

ill take a look at your action more but thatd be a good first step

rekram1-node avatar Oct 20 '25 13:10 rekram1-node

@rekram1-node I have updated to the latest tag, for whatever reason Renovate does not pick up your repo's tag format (that's a me problem). But latest tag worked with OpenAI provider (after they forced me through KYC, which was not needed a month ago 😢). So thanks! It sucks that GH copilot is not available, but imo in that case opencode should not allow it to be configured. Because at least back then it did, and I commited the code that it gave me.

alexaka1 avatar Oct 20 '25 15:10 alexaka1

Renovate can be fixed by this: https://github.com/alexaka1/distroless-dotnet-healthchecks/commit/ca3e57e67c589f16898ea4f53b7d3085171ec6f4

alexaka1 avatar Oct 20 '25 16:10 alexaka1