Repository navigation
fix(opencode): use node:http transport for ACP SDK calls on Windows - #64688
Open
lihongfang16 wants to merge 1 commit into
Open
lihongfang16 wants to merge 1 commit into
lihongfang16 wants to merge 1 commit into
Conversation
Bun's fetch on Windows never completes a request once the process holds an open streaming HTTP response. The ACP server keeps a long-lived SSE subscription (/global/event) to its own embedded server through the same SDK client that session methods use, so every session RPC starves forever on Windows. Route SDK traffic through node:http there, which is unaffected. Also fix the @acp/profile import in acp.ts, which does not resolve on the v1 branch (no such tsconfig path alias). Closes anomalyco#64686
This was referenced Nov 18, 2026
This was referenced Nov 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #64686
Type of change
What does this PR do?
On Windows, every ACP session method hangs forever because Bun's
fetchnever completes a request once the process holds an open streaming HTTP response. The ACP server keeps a long-lived/global/eventSSE subscription to its own embedded server (acp/event.ts) through the same SDK client that session RPCs use, so the concurrent SDK calls inloadDirectorySnapshotare starved andsession/new/session/listnever return (issue has the minimal bun repro).Fix: on win32, pass a
node:http-backed fetch tocreateOpencodeClientin the acp command.node:httpin the same process is unaffected by the bun bug, and the SSE subscription rides the same client so it moves to the new transport as well. No behavior change on other platforms.Also fixes the
@acp/profileimport inacp.ts, which doesn't resolve on the v1 branch (no such tsconfig path alias) — v1 HEAD currently fails to build with it.How did you verify your code works?
./packages/opencode/script/build.ts --single, bun 1.4.4)acp --pure→initializereturns,session/newhangs forever (reproduced on 1.15.13 through 1.19.6)acp --pure→initialize1.3s,session/newcompletes,session/promptstreams a model reply and settles withend_turntypecheckclean for the changed files (the remainingsrc/bus/global.tserror also reproduces on unmodified v1 HEAD locally on Windows; CI typecheck on Linux is green for v1 HEAD)Checklist