Skip to content

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

Description

@btriapitsyn

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions