Repository navigation
Description
Description
OpenCode consistently hangs during tool execution (Read, Glob, Grep) when using Starlink satellite internet. The same setup works perfectly when switching to 4G mobile connection.
The issue appears to be related to Starlink's network characteristics (satellite handoffs, latency jitter, CGNAT) causing the streaming HTTP connection to drop or stall without proper error handling/recovery.
Environment
- OpenCode version: 1.1.14
- OS: Ubuntu 22.04
- Node version: 22 (also tested with 24)
- Internet: Starlink satellite
- Provider: OpenCode Zen (also tested with OpenRouter - same issue)
- Terminal: Default
Steps to reproduce
- Connect to Starlink internet
- Open a Next.js project with App Router structure
- Ask OpenCode to analyze or fix code that requires reading multiple files
- OpenCode starts executing tools (Read, Glob, Grep)
- Mid-execution, it freezes with spinner showing "Reading file..." or similar
- No error message is displayed
- Logs show streaming started but then stops receiving message.part.updated events
Expected behavior
Tool execution completes and assistant responds, even on high-latency/unstable connections.
Actual behavior
OpenCode hangs indefinitely. The last log entries show:
```
INFO service=llm providerID=opencode modelID=claude-sonnet-4-5 ... stream
INFO service=bus type=message.part.updated publishing
INFO service=bus type=message.part.updated publishing
... (stream stops, no more entries)
```
Workaround
Switching from Starlink to 4G mobile connection resolves the issue completely.
Additional context
Starlink network characteristics that may cause this:
- Frequent satellite handoffs causing brief connection interruptions
- High latency jitter (20ms to 200ms+)
- Aggressive CGNAT with shorter connection timeouts
- TCP connections may be silently reset during satellite switches
Diagnostics performed:
- ✅ curl to api.opencode.ai works (both IPv4 and IPv6)
- ✅ No proxy configured
- ✅ DNS resolution works
- ✅ inotify limits are sufficient (65k+)
- ✅ Node 22 LTS installed
- ✅ Glob/filesystem operations work outside OpenCode
- ❌ NODE_OPTIONS="--dns-result-order=ipv4first" did not help
Possibly related issues:
- lsp bug: edit tool stalls after first diff; assistant hangs #6959 - LSP bug: edit tool stalls after first diff; assistant hangs
- Opencode Hangs when used as CLI tool #5888 - OpenCode Hangs when used as CLI tool
Suggested improvements
- Implement connection retry/reconnect logic for streaming responses
- Add configurable timeout settings for unstable connections
- Better error handling when stream drops - show error instead of hanging
- Optional non-streaming fallback mode for problematic networks
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
opencode.jsonwill causeopencodestartup to hang indefinitely #7789: Syntax error in opencode.json will cause opencode startup to hang indefinitely - Hangs without error displayFeel free to ignore if none of these address your specific case.
goniz commentedon Jan 12, 2026
This one is interesting 😆
I bet it's MTU, it's always MTU's fault ⛏️
andrea-nurale commentedon Feb 10, 2026
I have the same issue
tim-sh commentedon Feb 17, 2026
Hi @gabrielbuzziv,
I observed this issue with SAP AI Core (anthropic--claude-4.5-opus) on WiFi.
Evidence from strace investigation
Using
straceon opencode v1.1.59, I captured a session where the LLM stream appeared to hang for over 2 hours:session.prompt step=36startedservice=llm providerID=sap-ai-core modelID=anthropic--claude-4.5-opus ... streamsession.prompt cancel(manual abort via UI)Observations:
StreamIdleTimeoutErrorwas logged during this periodStrace-level detail
The process was blocked on
epoll_wait()as expected for async I/O, and health check requests were processed normally during this time. This indicates the event loop was running – the hang was specific to the LLM streaming call not receiving any data, rather than a process-wide freeze.Cheers,
Tim
nabilfreeman commentedon Feb 18, 2026
I think fixing this will likely fix other problems related to rapid network rotation, for example cellular machines, personal hotspot, network changes mid task - all of which I've experienced and am currently delicately working around when using Opencode
jamesofficer commentedon Apr 1, 2026
I also experience this issue, sadly LLM's border on unusable when on a Starlink connection. If anyone discovers a solution to this would love to hear it!
github-actions commentedon Jul 3, 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.