anomalyco / anomalyco/opencode

Workspace sync hangs in `connecting` forever when the target accepts but never answers

Open
#41,315 0 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 8, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

The workspace sync loop's connectSSE has no timeout on the connect phase. If a sync target accepts the TCP connection but never returns response headers, the fiber hangs inside http.execute forever: the workspace status stays connecting, nothing is logged, and the loop's retry/backoff below never runs.

It cannot heal itself afterwards either: startSync returns early while a fiber exists and the status is not error, so later sync starts are no-ops. Only restarting the server clears it.

We hit this in a real deployment where a loopback transport proxy accepted the connection during a startup race but didn't answer; the workspace showed connecting for 20+ minutes while direct curl to the same endpoint answered instantly.

Plugins

opencode-container-workspace (custom workspace adapter)

OpenCode version

1.18.12 (code path unchanged on current dev)

Steps to reproduce
  1. Register a workspace whose sync target accepts connections but never writes response headers (a bare net listener is enough).
  2. Start sync for that workspace.
  3. Status reports connecting indefinitely, no warning is logged, and subsequent sync starts do nothing.
Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.