OpenCode hangs indefinitely when sending requests to Anthropic via Oauth login #1113

Closed
opened 2026-02-16 17:29:29 -05:00 by yindo · 3 comments
Owner

Originally created by @plappag on GitHub (Aug 5, 2025).

Originally assigned to: @thdxr on GitHub.

Environment

  • OpenCode Version: 0.3.130
  • OS: Windows with WSL2 - Linux 6.6.87.2-microsoft-standard-WSL2
  • Platform: linux x86-64

Issue Description

OpenCode hangs indefinitely when attempting to send messages to the Anthropic API. This was working before but
suddenly stopped working. Authentication works correctly, models are detected, but any actual API request never
completes.

Steps to Reproduce

  1. Fresh install: curl -fsSL https://opencode.ai/install | bash
  2. Authentication successful: opencode auth login (OAuth flow completed)
  3. Verified auth: opencode auth list Shows Anthropic provider configured
  4. Started OpenCode: opencode --print-logs --log-level DEBUG
  5. Sent any message → Hangs forever

What Works

  • Installation and setup
  • Authentication (OAuth tokens present in ~/.local/share/opencode/auth.json)
  • Provider detection (opencode auth list shows Anthropic)
  • Model detection (logs show claude-sonnet-4-20250514 and claude-3-5-haiku-20241022 found)
  • TUI initialization
  • Session creation and management

What Fails

  • Any actual API request to Anthropic hangs indefinitely
  • No error messages or timeouts
  • Process must be killed manually

Debug Information

Auth Status:

{
  "anthropic": {
    "type": "oauth",
    "refresh": "sk-ant-ort01-[REDACTED]",
    "access": "sk-ant-oat01-[REDACTED]",
    "expires": 1754419110820
  }
}

Last Log Entries Before Hang:
INFO  2025-08-05T10:53:07 +1ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 getModel
INFO  2025-08-05T10:53:07 +0ms service=provider status=started providerID=anthropic getSDK
INFO  2025-08-05T10:53:07 +84ms service=provider status=completed duration=84 providerID=anthropic getSDK
INFO  2025-08-05T10:53:07 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 found
INFO  2025-08-05T10:53:07 +3ms service=session session=ses_78622ef09ffe1I46xY5lno4Sx4
sessionID=ses_78622ef09ffe1I46xY5lno4Sx4 locking
INFO  2025-08-05T10:53:07 +3ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 getModel
INFO  2025-08-05T10:53:07 +0ms service=provider status=started providerID=anthropic getSDK
INFO  2025-08-05T10:53:07 +0ms service=provider status=completed duration=0 providerID=anthropic getSDK
INFO  2025-08-05T10:53:07 +0ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 found
INFO  2025-08-05T10:53:08 +986ms service=bus type=storage.write publishing
INFO  2025-08-05T10:53:08 +0ms service=bus type=session.updated publishing
[HANGS HERE - NO FURTHER LOGS]

Additional Context

This was working fine previously but suddenly stopped working. We're on Windows using WSL2. Happy to test any
fixes or provide additional debugging information if needed.
Originally created by @plappag on GitHub (Aug 5, 2025). Originally assigned to: @thdxr on GitHub. ### Environment - **OpenCode Version:** 0.3.130 - **OS:** Windows with WSL2 - `Linux 6.6.87.2-microsoft-standard-WSL2` - **Platform:** linux x86-64 ### Issue Description OpenCode hangs indefinitely when attempting to send messages to the Anthropic API. This was working before but suddenly stopped working. Authentication works correctly, models are detected, but any actual API request never completes. ### Steps to Reproduce 1. Fresh install: `curl -fsSL https://opencode.ai/install | bash` 2. Authentication successful: `opencode auth login` (OAuth flow completed) 3. Verified auth: `opencode auth list` ✅ Shows Anthropic provider configured 4. Started OpenCode: `opencode --print-logs --log-level DEBUG` 5. Sent any message → **Hangs forever** ### What Works ✅ - Installation and setup - Authentication (OAuth tokens present in `~/.local/share/opencode/auth.json`) - Provider detection (`opencode auth list` shows Anthropic) - Model detection (logs show `claude-sonnet-4-20250514` and `claude-3-5-haiku-20241022` found) - TUI initialization - Session creation and management ### What Fails ❌ - Any actual API request to Anthropic hangs indefinitely - No error messages or timeouts - Process must be killed manually ### Debug Information **Auth Status:** ```json { "anthropic": { "type": "oauth", "refresh": "sk-ant-ort01-[REDACTED]", "access": "sk-ant-oat01-[REDACTED]", "expires": 1754419110820 } } Last Log Entries Before Hang: INFO 2025-08-05T10:53:07 +1ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 getModel INFO 2025-08-05T10:53:07 +0ms service=provider status=started providerID=anthropic getSDK INFO 2025-08-05T10:53:07 +84ms service=provider status=completed duration=84 providerID=anthropic getSDK INFO 2025-08-05T10:53:07 +0ms service=provider providerID=anthropic modelID=claude-sonnet-4-20250514 found INFO 2025-08-05T10:53:07 +3ms service=session session=ses_78622ef09ffe1I46xY5lno4Sx4 sessionID=ses_78622ef09ffe1I46xY5lno4Sx4 locking INFO 2025-08-05T10:53:07 +3ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 getModel INFO 2025-08-05T10:53:07 +0ms service=provider status=started providerID=anthropic getSDK INFO 2025-08-05T10:53:07 +0ms service=provider status=completed duration=0 providerID=anthropic getSDK INFO 2025-08-05T10:53:07 +0ms service=provider providerID=anthropic modelID=claude-3-5-haiku-20241022 found INFO 2025-08-05T10:53:08 +986ms service=bus type=storage.write publishing INFO 2025-08-05T10:53:08 +0ms service=bus type=session.updated publishing [HANGS HERE - NO FURTHER LOGS] Additional Context This was working fine previously but suddenly stopped working. We're on Windows using WSL2. Happy to test any fixes or provide additional debugging information if needed. ```
yindo closed this issue 2026-02-16 17:29:30 -05:00
Author
Owner

@thdxr commented on GitHub (Aug 5, 2025):

i need full logs can you do opencode run hey --print-logs

@thdxr commented on GitHub (Aug 5, 2025): i need full logs can you do `opencode run hey --print-logs`
Author
Owner

@thdxr commented on GitHub (Aug 5, 2025):

btw can you test if it works with an api key?

@thdxr commented on GitHub (Aug 5, 2025): btw can you test if it works with an api key?
Author
Owner

@plappag commented on GitHub (Aug 5, 2025):

Ok, not entirely sure what happened, it works now with opencode --hostname 0.0.0.0, it also worked on Windows side when I downloaded the binary. Hope this helps someone, if it was my fault my bad haha 😂

@plappag commented on GitHub (Aug 5, 2025): Ok, not entirely sure what happened, it works now with opencode --hostname 0.0.0.0, it also worked on Windows side when I downloaded the binary. Hope this helps someone, if it was my fault my bad haha 😂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1113