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
{{ message }}
Repository navigation
Provider stream hangs silently: no timeout, no error, no UI feedback; assistant message persisted empty (0 tokens) #59872
When the provider accepts the request but never sends any bytes back, the opencode client waits indefinitely. No error is surfaced, no retry is attempted, and the UI shows no feedback — it looks like an infinite spinner. After the fact, the assistant message row is persisted with 0 tokens and no parts, so the session appears to contain a message that was never generated.
Retrying the same request (abort with Esc + resend) connects fine immediately, which suggests a hung upstream connection rather than a client bug per se — but the client-side lack of any timeout/failure signal is the issue.
Environment
opencode 1.18.21, macOS (darwin)
Provider opencode-go, model glm-5.3-flash (also reproduced on provider opencode, model glm-5.3-flash-free on a prior occasion)
Repro / evidence
On 2026-10-28 UTC, two separate requests hung this way (one new session, one resumed session):
Session A (new): user message sent 09:58:56Z. Log shows only the title-generation stream starting; the main build stream never even logged a stream line:
Session B (resumed): assistant answered normally at 09:44:39Z, then two subsequent user messages (09:45:01Z, 09:57:54Z) got no response at all. Only log line before the hang:
Zero level=ERROR entries, zero retry/timeout logs in the entire window.
DB state after the fact (session A): assistant message row exists with tokens.input=0, tokens.output=0, no part rows attached — the empty response is persisted as if the turn completed.
Expected
A client-side timeout (or at least a stream-open deadline) that aborts the request and surfaces an error to the UI.
The failed turn should not be persisted as an empty assistant message, or should be marked as failed.
Workaround
Press Esc to abort and resend the message; retries connected on the first attempt both times.
You're on opencode 1.18.21, which is OpenCode v1. v1 now only gets fixes for critical bugs (data loss, security problems, or breakage with no workaround). Since Esc + resend works around this hang, it's unlikely to be fixed in v1.
We'd encourage you to try v2 (@opencode/cli, the opencode command), where active development happens. I can't promise v2 already handles this differently. Similar stream-hang problems are being tracked there. In order of how closely they match:
Update — likely root cause found, and it is not (only) the provider
Retested after the user's retries kept hanging. New evidence:
The hang is project-correlated, not provider-wide. The very same provider/model (opencode-go / glm-5.3-flash) streams instantly in a session whose cwd is a different project, while every hung request belongs to a session with cwd=/Users/gonzalo/Documents/cubo345 — including a brand-new session whose first short message hung at 09:58:56Z.
That project's git object store is corrupt./Users/gonzalo/Documents/cubo345/.git/objects/pack/pack-78c247bfae5271ac5bdb04542acb83b57e1f240c.pack is truncated (145,231,109 bytes against an idx from Oct 16 that does not match it; pack mtimes rewritten Oct 19 10:07). The opencode log has spammed git errors since 2026-10-19T14:18Z:
error: file .../pack-78c247....pack is far too short to be a packfile (repeated hundreds of times)
fatal: unable to read 004145cddf3f9db91b57b9cb596683c8eb420862
fatal: could not finish pack-objects to repack promisor objects
fatal: failed to run repack
The repo is a partial clone (blob:none promisor packs), so git operations that hit missing/corrupt objects trigger fetches against the promisor remote. If such a git invocation blocks (hung fetch / lock), opencode's pre-stream preparation never finishes and the LLM request is never opened — which exactly matches the observed signature: loop step=0 logged, no stream line, no ERROR, no retry, empty assistant message persisted with 0 tokens.
Retries (interrupt + resend at 10:34:47Z and 10:35:55Z) hung with the identical signature, reproducing 100%.
So the earlier framing ("provider accepts the request but never sends bytes") should be amended: the LLM request likely never gets sent in these cases — the hang occurs in opencode's git-dependent preparation for that project. Two hardening suggestions stand:
Put a deadline/timeout around the whole message-preparation phase (including any git calls, especially promisor fetches) and surface an error to the UI instead of hanging silently.
Don't persist the assistant message until the stream actually produces output.
(Notably, one earlier turn in the same corrupt-repo session did stream successfully at 09:44:39Z, so the blocking git path is hit intermittently — plausibly depending on which git operation/message-prep path runs.)
Timing confirmation: the 10:35:55Z attempt released at 10:40:22Z and streamed to completion normally (~14 s, 390 output tokens). The release coincides to the minute with a write finishing on the repo object store: listing /Users/gonzalo/Documents/cubo345/.git/objects/pack/ at 10:32Z showed pack-b8aec5a0....pack with mtime "Oct 19 10:07"; listing it again at 10:48Z showed mtime "Oct 28 07:40" local (= 10:40Z). Nothing external touched the repo between the listings; the blocked git operation itself completed after ~4.5 min and unblocked opencode message prep, which then opened the LLM stream instantly. No git processes or .lock files remain. The corrupt pack-78c247....pack is untouched, so the intermittent hang remains reproducible.
Closing this as not planned. You reported it on opencode 1.18.21 (v1), and v1 now only gets fixes for critical bugs. This hang has a workaround that works (Esc + resend), and we haven't heard that it also happens on v2.
If you see the same silent hang or the empty 0-token assistant message on v2 (@opencode/cli), please open a new issue with the v2 version and logs, or comment on #53747 if it matches. Thanks again for the detailed report!
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and the logs!
You're on opencode 1.18.21, which is OpenCode v1. v1 now only gets fixes for critical bugs (data loss, security problems, or breakage with no workaround). Since Esc + resend works around this hang, it's unlikely to be fixed in v1.
We'd encourage you to try v2 (
@opencode/cli, theopencodecommand), where active development happens. I can't promise v2 already handles this differently. Similar stream-hang problems are being tracked there. In order of how closely they match:If you see the same hang on v2, or think this is critical in v1, please reply here with the v2 version and logs.
gonzaloguzmans commentedon Oct 28, 2026
Update — likely root cause found, and it is not (only) the provider
Retested after the user's retries kept hanging. New evidence:
The hang is project-correlated, not provider-wide. The very same provider/model (
opencode-go/glm-5.3-flash) streams instantly in a session whose cwd is a different project, while every hung request belongs to a session withcwd=/Users/gonzalo/Documents/cubo345— including a brand-new session whose first short message hung at 09:58:56Z.That project's git object store is corrupt.
/Users/gonzalo/Documents/cubo345/.git/objects/pack/pack-78c247bfae5271ac5bdb04542acb83b57e1f240c.packis truncated (145,231,109 bytes against anidxfrom Oct 16 that does not match it; pack mtimes rewritten Oct 19 10:07). The opencode log has spammed git errors since 2026-10-19T14:18Z:The repo is a partial clone (
blob:nonepromisor packs), so git operations that hit missing/corrupt objects trigger fetches against the promisor remote. If such a git invocation blocks (hung fetch / lock), opencode's pre-stream preparation never finishes and the LLM request is never opened — which exactly matches the observed signature:loop step=0logged, nostreamline, no ERROR, no retry, empty assistant message persisted with 0 tokens.Retries (interrupt + resend at 10:34:47Z and 10:35:55Z) hung with the identical signature, reproducing 100%.
So the earlier framing ("provider accepts the request but never sends bytes") should be amended: the LLM request likely never gets sent in these cases — the hang occurs in opencode's git-dependent preparation for that project. Two hardening suggestions stand:
(Notably, one earlier turn in the same corrupt-repo session did stream successfully at 09:44:39Z, so the blocking git path is hit intermittently — plausibly depending on which git operation/message-prep path runs.)
gonzaloguzmans commentedon Oct 28, 2026
Timing confirmation: the 10:35:55Z attempt released at 10:40:22Z and streamed to completion normally (~14 s, 390 output tokens). The release coincides to the minute with a write finishing on the repo object store: listing /Users/gonzalo/Documents/cubo345/.git/objects/pack/ at 10:32Z showed pack-b8aec5a0....pack with mtime "Oct 19 10:07"; listing it again at 10:48Z showed mtime "Oct 28 07:40" local (= 10:40Z). Nothing external touched the repo between the listings; the blocked git operation itself completed after ~4.5 min and unblocked opencode message prep, which then opened the LLM stream instantly. No git processes or .lock files remain. The corrupt pack-78c247....pack is untouched, so the intermittent hang remains reproducible.
opencodejr commentedon Oct 29, 2026
Closing this as not planned. You reported it on opencode 1.18.21 (v1), and v1 now only gets fixes for critical bugs. This hang has a workaround that works (Esc + resend), and we haven't heard that it also happens on v2.
If you see the same silent hang or the empty 0-token assistant message on v2 (
@opencode/cli), please open a new issue with the v2 version and logs, or comment on #53747 if it matches. Thanks again for the detailed report!