Skip to content

fix(cli): fail when the event stream never opens instead of hanging - #62729

Open
Xtacy856X wants to merge 4 commits into
anomalyco:devfrom
Xtacy856X:fix/62681-event-stream-stall
Open

Xtacy856X wants to merge 4 commits into
anomalyco:devfrom
Xtacy856X:fix/62681-event-stream-stall

Conversation

@Xtacy856X

@Xtacy856X Xtacy856X commented Nov 8, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #62681

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

opencode run and the ACP client waited for the first event of /api/event with no limit, and the TUI reconnected forever when the event stream never opened. When a proxy, tunnel or VPN answers the subscribe request and then holds the body open, the client waits with no output until something else kills it.

  • run/noninteractive.ts: the subscription is now opened under the caller's signal, so SIGINT and SIGTERM end the opening wait at once instead of after the deadline, and the wait is bounded (10s) with "The OpenCode server accepted the event stream but sent nothing within 10s". The iterator is closed in a finally whatever happens, so a timeout no longer leaves the connection open.
  • acp/connection.ts: awaitConnected fails with EventStreamUnavailable when the stream never opens, and returns at once when it already opened, so a session or catalog request more than 10s into a healthy connection is still served. turn.ts, catalog.ts and sessions.ts use it.
  • tui/src/mini/stream-v2.transport.ts: the connect timeout only rejects while the session has not started. A stall after server.connected is a dropped connection, so it writes "reconnecting" and retries.

How did you verify your code works?

packages/cli: bun test test/run/noninteractive.test.ts test/acp -> 127 pass, 3 skip, 0 fail. packages/tui: bun test test/mini/stream-v2.transport.test.ts -> 72 pass. bun check --no-script -b clean in both packages, prettier and oxlint clean.

New tests:

  • noninteractive.test.ts: a stream that never yields fails after 10s with the message and the subscription is closed; aborting during the opening wait returns immediately and closes it too.
  • acp/event-stream.test.ts: on a healthy stream a session request after the connect timeout still succeeds; a silent stream still fails the turn with -32603 EventStreamUnavailable.
  • stream-v2.transport.test.ts: a stalled second stream reconnects and a third stream resumes the session.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #62682

`opencode run` subscribes to /api/event and waits for the opening
`server.connected` event before it sends the prompt. A proxy, tunnel or VPN
that holds the subscription open without forwarding anything makes that wait
unbounded: the session is created, no prompt is ever sent, and the command
hangs with no output (issue anomalyco#62681).

Bound the wait with `ACPConnection.ConnectedTimeout` (10s, overridable) and
report it:

- the turn fails with `ACPEventStreamUnavailableError`, which reaches the CLI
  as "The OpenCode server is reachable but sent no events within 10s. Something
  between this client and the server, such as a proxy, tunnel or VPN, is
  probably buffering the event stream." and no prompt is submitted;
- the catalog and session attach only wait for event ordering, so they now
  continue after the deadline instead of blocking every command that needs a
  catalog.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Nov 8, 2026

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't fix #62681 yet. I ran the issue's reproduction (a proxy that sends the /api/event headers but holds back the body) with opencode run --server <proxy> from source. With this branch it behaves exactly as on dev: nothing is printed, no prompt is sent, and it hangs until killed (exit 124 after 30s, then "shutdown did not finish within 10s").

The reason is that opencode run doesn't go through the ACP code. commands/handlers/run.ts → run/run.ts → runNonInteractivePrompt, which waits on await stream.next() at packages/cli/src/run/noninteractive.ts:69 with no time limit. The same unbounded first-event wait exists in packages/tui/src/mini/stream-v2.transport.ts (connect(), nextEvent) for opencode mini. A fix for the issue should put a time limit on that wait (and probably the mini one) and exit non-zero with your message. A test should then drive runNonInteractivePrompt against a stream that never sends anything. As it stands, the PR only changes opencode acp, and its tests only cover the ACP wire fixture. If you also want the ACP change, please describe it as an ACP fix rather than Fixes #62681.

On the ACP part itself, see the inline comments: on a silent stream, every session attach waits the full 10s again, and catalog and sessions can miss events once they carry on past the deadline.

Public API: unchanged. The only addition is a new ACP error, errorName: "EventStreamUnavailable".

Verified with the issue's proxy reproduction on base and head, bun test test/acp (103 pass), and tsc -b (clean).

Related: #62682

const connected = yield* take(turn.subscription)
// A buffered stream never delivers it, and submitting anyway would wait for events forever.
const timeout = yield* ACPConnection.ConnectedTimeout
const opened = yield* take(turn.subscription).pipe(Effect.timeoutOption(timeout))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only covers opencode acp. The command in #62681, opencode run, waits for the first event at packages/cli/src/run/noninteractive.ts:69 (await stream.next()), and that wait is still unbounded. With the issue's proxy reproduction, opencode run on this branch still hangs until killed. The fix for the issue needs to go there, and probably in packages/tui/src/mini/stream-v2.transport.ts connect() for mini.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, the issue was in the wrong place. Moved it:

  • packages/cli/src/run/noninteractive.ts: the opening stream.next() now goes through firstEvent(), which has a 10s deadline and rejects with "The OpenCode server accepted the event stream but sent nothing within 10s. Something between this client and the server, such as a proxy, tunnel or VPN, is probably buffering it." A test in test/run/noninteractive.test.ts reproduces the buffered body with a next() that never settles and asserts the run fails instead of hanging.
  • packages/tui/src/mini/stream-v2.transport.ts: the same wait in connect() is bounded through nextEvent(stream, signal, stall), and a StreamStalledError fails the boot through readyReject rather than looping on reconnecting every 250ms. Covered in test/mini/stream-v2.transport.test.ts.

The ACP part is kept, but only as the in-protocol variant of the same failure.

attach: Effect.fn("cli.acp.sessions.attach")(function* (session, cwd, mcpServers) {
yield* Deferred.await(connected)
// Attaching no longer blocks on a stream that never opens; the turn reports that failure.
yield* ACPConnection.awaitConnected(connected)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result of awaitConnected is ignored here, and connected never completes on a silent stream. So every session/new or session/load waits the full 10s again, and so does each new cwd in catalog.ts. Each prompt then waits another 10s before failing. Once the code carries on, an event that arrives between loading and the late server.connected can also be missed, which is the ordering the wait was there to protect. It may be better to remember the timeout once, or to fail fast here with the same EventStreamUnavailableError, rather than silently continuing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, carrying on was the wrong call. awaitConnected now fails with EventStreamUnavailableError and remembers the deadline per connection (connectionDeadlines, keyed by the connected Deferred), so a caller that arrives after the stream was already declared silent fails at once instead of waiting the full timeout again.

sessions.attach and catalog.create therefore report the stall on the first request, and EventStreamUnavailableError is now part of CatalogError so the catalog channel carries it. The tests in test/acp/event-stream.test.ts cover both halves: session/new returns -32603 with EventStreamUnavailable, and a second session/new on the same connection fails in under 50ms instead of waiting another 100ms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing fast on a silent stream is fine, and the new tests cover that case. The problem is the healthy case, which they don't exercise. In awaitConnected (connection.ts:36–40), once Date.now() passes the stored deadline, remaining > 0 is false and it fails without checking connected, even when server.connected arrived long ago. I reproduced it on this commit with the wire fixture: startWire({ connectTimeout: "100 millis" }) with the normal (non-buffered) stream, newSession() succeeds, then after Bun.sleep(300) a second newSession() fails with EventStreamUnavailable. With the default 10s, any ACP client that opens another session, or a catalog for a new cwd, more than 10s after the first would be refused.

To fix it, check Deferred.isDone(connected) (or Deferred.poll) first and return when it's done; only fail fast when it's still pending after the deadline. A test with a healthy stream and a late second newSession() would cover it. The mini reconnect point (stream-v2.transport.ts:1559: only reject while state.initial, otherwise fall through to the reconnect path) is also still open.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 498cdd3. awaitConnected now returns at once when Deferred.poll(connected) shows the stream is already open, so the deadline only bounds a stream that never arrived. Reproduced your case as a test: startWire({ connectTimeout: "100 millis" }), newSession(), Bun.sleep(300), second newSession() succeeds.

The mini reconnect point is fixed too: the StreamStalledError branch now requires state.initial, so a stall after server.connected writes "reconnecting" and retries instead of resolving ready that has already resolved. New test drives that path with a stalled second stream and a healthy third one.

`opencode run` waited for the opening event with an unbounded `stream.next()`, so a
proxy that answers the subscribe request and then holds the body open left the
command hanging forever, with no session and no output (anomalyco#62681). The wait now has a
10s deadline and fails with a message that names the buffering middlebox.

The same wait in the mini transport `connect()` is bounded too, and a stream that
never opens fails the boot instead of looping on `reconnecting`.

For `opencode acp`, `awaitConnected` now fails with EventStreamUnavailableError and
remembers the deadline once per connection, so `session/new` reports the stall
instead of every later request waiting another 10s, and an event that arrives
between loading and a late `server.connected` can no longer be missed.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opencode run is fixed now. With the issue's buffering-proxy reproduction it exits with code 1 after about 11s and prints the new error, instead of hanging until it is killed. My earlier concern about the wrong layer is resolved. The repeated 10s wait per attach is gone too, but the way it was fixed breaks ACP sessions on a healthy stream, which blocks the merge (inline comment on connection.ts). I reproduced it with the wire fixture: with a 100ms timeout and a working event stream, a second session/new 300ms after the first fails with EventStreamUnavailable. With the default 10s, any ACP client that opens a session, or a catalog for another cwd, more than 10s after the first would be refused.

There's also a smaller issue in the mini transport: a reconnect attempt that stalls now stops the event loop with no error (inline comment).

Checked with: the reproduction script, bun test test/acp test/run in packages/cli (130 pass), bun test test/mini/stream-v2.transport.test.ts in packages/tui (71 pass), and tsc -b in packages/cli (clean).

Public API: unchanged, apart from ACP session/new and session/load (and catalog requests) now being able to fail with errorName: "EventStreamUnavailable".

Related: #62682

export const awaitConnected = (connected: Deferred.Deferred<void>) =>
Effect.gen(function* () {
const timeout = yield* ConnectedTimeout
const deadline = connectionDeadlines.get(connected) ?? Date.now() + Duration.toMillis(timeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the deadline has passed, remaining > 0 is false, so this fails without checking connected. That happens even when the stream opened long ago. On a healthy connection, every attach or catalog create that comes more than 10s after the first call gets EventStreamUnavailable. I reproduced it: startWire({ connectTimeout: "100 millis" }), newSession() succeeds, then after Bun.sleep(300) a second newSession() fails. Check Deferred.isDone(connected) (or Deferred.poll) first and return if it's done; only fail fast when it's still pending after the deadline. Please also add a test for the healthy late-request case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 498cdd3: awaitConnected polls the deferred first and returns when it is already done, so a request more than 10s into a healthy connection is served. Your reproduction is now a test in packages/cli/test/acp/event-stream.test.ts (a later request is served after the connect timeout has passed).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, confirmed on 498cdd3: Deferred.poll returns early once the stream has opened, and a later request is served after the connect timeout has passed passes along with the rest of test/acp. This one is resolved.

The one open point is in packages/cli/src/run/noninteractive.ts (line 110): on SIGINT/SIGTERM the subscription is closed before cancel() finishes, and cancel() still needs the stream to see background jobs end.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f8f7ebd. The signal is no longer forwarded to the subscription, which is what was closing the stream: cancel() waits on state.ended, and only consume() resolves that, from the terminal events of the jobs it just stopped. Closing the stream on SIGINT/SIGTERM took those events away, so the loop sat on await ended until the shutdown timeout and the process exited 1.

The startup case still ends at once. firstEvent races stream.next() against the caller's signal itself, and the finally aborts the controller and returns the iterator, so a signal during the opening wait closes the subscription and returns in milliseconds. A run that is cancelled before it starts still opens no subscription at all, since if (input.signal.aborted) controller.abort() runs before subscribe.

New test, a cancelled run keeps the stream open so the jobs it stopped can finish, in packages/cli/test/run/noninteractive.test.ts. The mocked subscription closes on abort like the real client does, a background shell started after admission keeps cancel() waiting, and the terminal event pushed after the signal lets the run finish. It fails on 498cdd3 (hung after 2 s) and passes here.

Checks: bun test test/run test/acp gives 129 pass, 3 skip. additional-directories.subprocess.test.ts timed out once under parallel load on Windows and passes alone in 4 s. bun run typecheck in packages/cli is clean over 2,183 files, and oxlint plus prettier report nothing on the two changed files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I checked f8f7ebd in the code: the caller's signal no longer closes the subscription, so consume() keeps getting events while cancel() waits on state.ended. The opening wait still stops on the signal through firstEvent, and the outer finally closes the stream. That resolves the cancellation point. I only read the diff and haven't rerun the tests here. Both of my earlier ACP and mini points were already resolved in 498cdd3.

if (controller.signal.aborted || input.footer.isClosed) return
// A stream that never opens is not a dropped connection: reconnecting would only hide the
// buffering proxy behind a reconnect loop that never settles.
if (error instanceof StreamStalledError) return readyReject(error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also runs for reconnect attempts after the session was already running. ready has resolved by then, so readyReject does nothing and connect() simply returns. The session stops getting events with no error and no "reconnecting" status. Only reject here while state.initial is true; after that, a stall should fall through to the normal reconnect path, which the new time limit now makes possible.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 498cdd3: the branch is now if (error instanceof StreamStalledError && state.initial) return readyReject(error), so a reconnect attempt that stalls falls through to the normal reconnect path (status "reconnecting", 250ms wait, new subscribe). Covered by a new test in packages/tui/test/mini/stream-v2.transport.test.ts where the second stream stalls and the third resumes the session.

@r266-tech

Copy link
Copy Markdown
Contributor

At d6075d67, the first-event wait still misses cancellation and cleanup in run/noninteractive.ts:

  • With a real CLI subprocess and a local SSE endpoint that sends only a comment, SIGTERM after /api/event is opened takes another 10 seconds to exit 143, printing shutdown did not finish within 10s. Connecting the input signal before this wait makes the same fixture exit 143 in 16 ms without that warning.
  • An in-process regression using the actual SDK and HTTP body confirms that after advancing the 10-second deadline with fake timers, the subscription remains open. It closes with startup cleanup added. The current firstEvent(stream) await is outside the later cleanup block.

Please propagate input.signal during startup and abort the subscription/close its iterator on timeout or failure. The existing never-resolving mock test checks rejection but cannot detect the leaked connection. Add coverage for cancellation before server.connected too.

macOS arm64, Bun 1.4.4; no prompt/provider requests. AI-assisted investigation.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Xtacy856X

Copy link
Copy Markdown
Author

Both are fixed in 498cdd3.

The subscription is now created inside the run's cleanup: it is opened under a controller that follows input.signal, so a SIGTERM during startup aborts the wait instead of leaving it to the deadline, and the iterator is closed in a finally on timeout, failure or cancellation. A cancelled run returns quietly, since the caller owns the exit code.

firstEvent takes the signal, races it against stream.next() and the deadline, and removes its listener afterwards.

Coverage added: cancelling before the first event closes the subscription instead of waiting (in-process, asserts the iterator's return ran and the call returns at once) and the existing deadline test now also asserts the iterator was closed.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue's buffering-proxy reproduction is fixed: opencode run now exits with code 1 after about 10s and prints the new error. Both points from my last review are resolved. awaitConnected returns early once the stream has opened, and the new healthy late session/new test passes. In mini, a stalled stream only fails startup on the first connection; later stalls reconnect.

One new problem in this commit, found by reading the code: runNonInteractivePrompt now closes the event stream as soon as SIGINT or SIGTERM arrives, but cancel() still needs it (inline comment). Ctrl-C while background shells or subagents are still running can then hang until the 10s shutdown limit.

Checked with: the reproduction script, bun test test/acp test/run in packages/cli (132 pass), bun test test/mini/stream-v2.transport.test.ts in packages/tui (72 pass), and tsc -b in both (clean).

Public API: unchanged, apart from ACP session/new and session/load (and catalog requests) now failing with errorName: "EventStreamUnavailable" when the event stream never opens.

Related: #62682

Comment thread packages/cli/src/run/noninteractive.ts Outdated
const controller = new AbortController()
// SIGINT and SIGTERM must interrupt the opening wait too, so the subscription is opened under the
// caller's signal and closed again whatever happens to the run.
const abort = () => controller.abort()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This closes the subscription as soon as input.signal aborts, but on dev it stayed open until cancel() finished, and cancel() still depends on it. After session.wait, if background shells or subagents are still running, it waits on state.ended, and only consume() resolves that from stream events. Subagents that start again while cancelling are also interrupted from the stream (session.execution.started while phase === "cancelling"). With the stream closed, consume() returns and neither happens, so Ctrl-C during background work can hang until the 10s shutdown limit. firstEvent already watches input.signal, so this listener isn't needed for the opening wait. Dropping it and keeping the controller.abort() in the outer finally keeps both the new fix and the old cancel behaviour.

@r266-tech

Copy link
Copy Markdown
Contributor

Rechecked 498cdd38: both findings from my earlier comment are fixed. With the real CLI and comment-only SSE, startup SIGTERM/SIGINT exit 143/130 promptly (6/13 ms after subscription). The 10-second timeout also closes the real SDK/HTTP subscription.

I reproduced the remaining cancellation concern with real CLI subprocesses against local HTTP fixtures:

  • Connect, admit a synthetic prompt, and report a background shell/subagent. Signal the CLI, acknowledge removal/interruption, but keep the job running through the next session.wait/job-list read; then emit its terminal SSE event.
  • On this head, the subscription closes before that event. Both shell+SIGTERM and subagent+SIGINT hit shutdown did not finish within 10s and exit 1 after ~11.5s.
  • Removing only the early input.signal.addEventListener("abort", abort, ...) registration makes the same fixtures consume the terminal event and exit 143/130 in 40 ms. The firstEvent signal race and outer cleanup remain unchanged. Startup cancellation, real HTTP timeout cleanup, and all 24 existing noninteractive tests still pass with that control.

macOS arm64, Bun 1.4.4; synthetic server/job fixtures, no provider calls. AI-assisted verification.

… jobs

Forwarding the caller's signal to the subscription closed the stream as soon as SIGINT or
SIGTERM arrived, and `cancel()` waits for the terminal events of the jobs it just stopped, so
a run with a background shell or subagent in flight sat out the shutdown timeout and exited 1
instead of 143 or 130. The opening wait already takes the signal itself, so the stream now stays
open until the run is over and is closed in the finally either way.
@Xtacy856X

Copy link
Copy Markdown
Author

@r266-tech the cancellation case you reproduced is fixed in f8f7ebd.

You were right that the early input.signal.addEventListener("abort", abort, ...) registration was the cause: it aborted the subscription controller on SIGINT/SIGTERM, so the terminal events of the background shell or subagent never reached consume(), state.ended never resolved, and cancel() waited out the shutdown timeout. That registration is gone; the opening wait keeps its own signal race, so a signal during startup still exits in milliseconds, and the stream is closed in the finally once the run is over.

a cancelled run keeps the stream open so the jobs it stopped can finish covers it at the unit level and fails on 498cdd3 (hung after 2 s). If you can run your real-CLI fixtures against this head it would be worth it: they caught what the mocks missed the first time.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last open point is addressed. A cancelled opencode run keeps the event stream open until cancel() has seen its background jobs end, as on dev. The opening wait still stops on SIGINT/SIGTERM through firstEvent, and the outer finally closes the stream. The new test checks this against a mock stream that closes on abort, like the real client does. All earlier threads are resolved, and I found nothing new.

Checked with: the issue's buffering-proxy reproduction (opencode run exits with code 1 after about 10s with the new error, instead of hanging), bun test test/acp test/run in packages/cli (133 pass), and tsc -b in packages/cli (clean).

Public API: unchanged, apart from ACP session/new and session/load (and catalog requests) now failing with errorName: "EventStreamUnavailable" when the event stream never opens.

@r266-tech

Copy link
Copy Markdown
Contributor

Rechecked f8f7ebd4ac814dfe78af7afc7dec01fc522832e2 with the same real-CLI HTTP/SSE fixtures: the cancellation regression is resolved on this head.

Background fixture Exit code Time after signal
shell + SIGTERM 143 49 ms
subagent + SIGINT 130 48 ms

Both keep the subscription open while the stop is acknowledged but the job is still running, receive the terminal SSE event, read back an empty job list, and then close the subscription. Neither prints shutdown did not finish.

Startup cancellation before server.connected still exits 143/130 in 7 ms and closes the HTTP subscription, without sending a prompt. The actual SDK/HTTP timeout cleanup check also passes with the 10-second clock advanced; all 25 test/run/noninteractive.test.ts tests pass.

macOS arm64, Bun 1.4.4; synthetic local server/job data, no provider calls. AI-assisted verification.

@Xtacy856X

Copy link
Copy Markdown
Author

Thanks for running the fixtures against this head, that is exactly the signal I could not get from mocks.

For completeness, the three earlier threads on the ACP side are also addressed at f8f7ebd:

  • acp/connection.ts: awaitConnected polls the deferred first and returns when the stream is already open, so a request that arrives long after the timeout is served. The deadline is also remembered per connection, which is the reproduction you posted (connectTimeout: 100 millis, then Bun.sleep(300)), and it is covered by a later request is served after the connect timeout has passed in packages/cli/test/acp/event-stream.test.ts.
  • acp/sessions.ts: the result of awaitConnected is now yielded, so a silent stream fails session/new and session/load with EventStreamUnavailableError instead of continuing and waiting again.
  • acp/turn.ts: the gap you pointed at was that only opencode acp bounded the wait. run/noninteractive.ts now races the first event against the signal and the deadline and closes the iterator on timeout or failure, which is what your comment-only SSE fixture exercises.

All check runs on this head are green and the PR is mergeable. If nothing else is outstanding, the review threads above can be resolved.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: run hangs before creating a session when the initial SSE event is buffered

2 participants