You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Investigation complete. The OpenCode GitHub Agent gets stuck due to session management issues in the ACP implementation, particularly around timeout handling and event processing loops.
If you are using claude code subscription how are you completing the oauth exchange in CI?
I had claude write me an OAuth Refresh job that checks for OAuth token expiry and refresh tokens when needed. It refreshes token fine and was working before, just became a more prominent issue since yesterday.
- name: Refresh OAuth tokens if needed
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
CURRENT_TIME=$(($(date +%s) * 1000))
TOKEN_EXPIRES=${{ secrets.ANTHROPIC_EXPIRES }}
# Check if token needs refresh (expires in less than 1 hour)
if [ $((TOKEN_EXPIRES - CURRENT_TIME)) -lt 3600000 ]; then
echo "🔄 Token expiring soon, refreshing..."
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST https://console.anthropic.com/v1/oauth/token \
-H "Content-Type: application/json" \
-d "{
\"grant_type\": \"refresh_token\",
\"refresh_token\": \"${{ secrets.ANTHROPIC_REFRESH_TOKEN }}\",
\"client_id\": \"9d1c250a-e61b-44d9-88ed-5944d1962f5e\"
}")
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -n -1)
if [ "$HTTP_CODE" -eq "200" ]; then
echo "✅ Token refresh successful!"
NEW_ACCESS=$(echo "$BODY" | jq -r '.access_token')
NEW_REFRESH=$(echo "$BODY" | jq -r '.refresh_token')
EXPIRES_IN=$(echo "$BODY" | jq -r '.expires_in')
NEW_EXPIRES=$(($(date +%s) * 1000 + EXPIRES_IN * 1000))
# Update GitHub Secrets for future runs
echo "📝 Updating GitHub secrets..."
gh secret set ANTHROPIC_ACCESS_TOKEN --body "$NEW_ACCESS"
gh secret set ANTHROPIC_REFRESH_TOKEN --body "$NEW_REFRESH"
gh secret set ANTHROPIC_EXPIRES --body "$NEW_EXPIRES"
echo "✅ Tokens refreshed and persisted"
else
echo "❌ Token refresh failed with status $HTTP_CODE"
echo "$BODY"
exit 1
fi
else
echo "✅ Token still valid, no refresh needed"
fi
Just an update... This is happening for me, even with OpenCode provider so def. isn't something Claude Code Subscription specific. I wonder how more people are not facing it since I face it almost every day and multiple times throughout the day.
@rekram1-node Any ideas how-to do it? Because when OpenCode step is stuck, it can only be cancelled or timeout and in both cases, any further steps do not run 🤔
when tried to use custom agent prompt, it stuck, default prompt works fine.
If it's already sending some stream of data for longer amount of time, is there a flag to print it in realtime?
Sessions:
ses_281665859ffemt9MPP4jm9PT6G (cancelled at 15m+)
ses_28153e2b2ffegp2cW1PqaUqlYa (cancelled at 2m+ to test)
No errors in the logs, just info lines.
Shorter prompts works fine, so I think the agent was just spending a lot of times, but the problem is that we don't see it, and it looks like it's stuck.
Is there a way to enable stream of data being sent, to see what's doing?
Job stuck for 1.5h+ on Sending message to opencode..., does it mean it's eating tokens during that time, or it's just stuck? opencode session ses_264d286a3ffeFZ9CisDMEJdF6r
Model: opencode/gpt-5-codex, then I've re-run using same prompt using opencode/gemini-3-flash, it worked.
Another hang with simple prompt.
I've asked it to load a skill and tell about it.
opencode session ses_25f478871ffewkRNNiUh464oku
Sending message to opencode...
(stuck for 1h+ mins, and it's not clear whether it's burning tokens or not for this simple query)
PROMPT: Load all skills and tell me what's them. Don't use ls to find it.
Checking out new branch...
Sending message to opencode...
Error: The operation was canceled.
I find opencode action not usable at this point as it happens at random and it's probably burning a lot of tokens.
This relates to GH-16180 (Cloudflare 524 timeout) as confirmed from the logs.
Potential fix in GH-16181 which was closed, please re-open.
Problem happens on daily basis, 1/10 sessions become stuck for very long time.
Activity
github-actions commentedon Nov 24, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case differs from these issues.
rekram1-node commentedon Nov 24, 2025
/oc test
opencode-agent commentedon Nov 24, 2025
Investigation complete. The OpenCode GitHub Agent gets stuck due to session management issues in the ACP implementation, particularly around timeout handling and event processing loops.
opencode session | github run
rekram1-node commentedon Nov 24, 2025
thats made up ^ lol but ill look into it, ofc cant replicate tho
rekram1-node commentedon Nov 24, 2025
What provider are u using?
thehaseebahmed commentedon Nov 24, 2025
I'm using Claude Code Subscription. I can try with OpenCode Zen as well if that helps.
rekram1-node commentedon Nov 24, 2025
If you are using claude code subscription how are you completing the oauth exchange in CI?
thehaseebahmed commentedon Nov 24, 2025
I had claude write me an OAuth Refresh job that checks for OAuth token expiry and refresh tokens when needed. It refreshes token fine and was working before, just became a more prominent issue since yesterday.
rekram1-node commentedon Nov 24, 2025
And then you are creating an auth.json file with ANTHROPIC_ACCESS_TOKEN and the other vars?
thehaseebahmed commentedon Nov 24, 2025
Yes! That is what I'm doing. My bad, I could've pasted the whole workflow here. Here it goes:
thehaseebahmed commentedon Nov 24, 2025
Same behavior on a self-hosted runner but stuck at a different stage.
thehaseebahmed commentedon Nov 27, 2025
@rekram1-node This is starting to happen more and more frequently. Can you identify something wrong in this github workflow?
rekram1-node commentedon Nov 27, 2025
yeah ill take a look when I get a chance
thehaseebahmed commentedon Nov 29, 2025
Just an update... This is happening for me, even with OpenCode provider so def. isn't something Claude Code Subscription specific. I wonder how more people are not facing it since I face it almost every day and multiple times throughout the day.
rekram1-node commentedon Nov 30, 2025
Hmm weird, yeah haven't heard any other reports of this.
Can you share what you are doing? Maybe you can export some logs from the github action?
I think you could make them artifacts, the logs are stored at ~/.local/share/opencode/log/....
Getting some logs would prolly nail this down
Session share link may work too
thehaseebahmed commentedon Nov 30, 2025
@rekram1-node Any ideas how-to do it? Because when OpenCode step is stuck, it can only be cancelled or timeout and in both cases, any further steps do not run 🤔
dhowe commentedon Mar 22, 2026
same problem here with Qwen3.5:35b, 'Build' agent repeatedly hangs while working
basically unusable, not sure how to debug
cogni-ai-ee commentedon Apr 11, 2026
Same here:
when tried to use custom agent prompt, it stuck, default prompt works fine.
If it's already sending some stream of data for longer amount of time, is there a flag to print it in realtime?
Sessions:
ses_281665859ffemt9MPP4jm9PT6G(cancelled at 15m+)ses_28153e2b2ffegp2cW1PqaUqlYa(cancelled at 2m+ to test)No errors in the logs, just info lines.
Shorter prompts works fine, so I think the agent was just spending a lot of times, but the problem is that we don't see it, and it looks like it's stuck.
Is there a way to enable stream of data being sent, to see what's doing?
feat: add timeout for opencode job and log printing on failure
kenorb commentedon Apr 17, 2026
Job stuck for 1.5h+ on
Sending message to opencode..., does it mean it's eating tokens during that time, or it's just stuck?opencode session ses_264d286a3ffeFZ9CisDMEJdF6rModel:
opencode/gpt-5-codex, then I've re-run using same prompt usingopencode/gemini-3-flash, it worked.cogni-ai-ee commentedon Apr 18, 2026
Another hang with simple prompt.
I've asked it to load a skill and tell about it.
opencode session ses_25f478871ffewkRNNiUh464oku
Sending message to opencode...
(stuck for 1h+ mins, and it's not clear whether it's burning tokens or not for this simple query)
--
Another hang for 6h:
opencode session ses_25ed9bf76ffesJrzZaTFGB14bh
I find opencode action not usable at this point as it happens at random and it's probably burning a lot of tokens.
cogni-ai-ee commentedon May 13, 2026
Another hung in this build.
It's possible that it wrongly escaped some quotes? It's possible to set/override the timeout of each command, so it can re-try?
cogni-ai-ee commentedon May 13, 2026
This relates to GH-16180 (Cloudflare 524 timeout) as confirmed from the logs.
Potential fix in GH-16181 which was closed, please re-open.
Problem happens on daily basis, 1/10 sessions become stuck for very long time.
github-actions commentedon Jul 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.