Skip to content

πŸ¦‹ New version release - #506

Merged
brentrager merged 1 commit into
mainfrom
changeset-release/main
Aug 19, 2026
Merged

πŸ¦‹ New version release#506
brentrager merged 1 commit into
mainfrom
changeset-release/main

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@smooai/smooth-operator@1.55.3

Patch Changes

  • ec1b9c4: go-server: fix the P1 connection deadlock (and permanent goroutine/socket leak) when a client disconnects mid-turn.

    The per-connection outbound sink is a bounded channel (64), and the writer goroutine returned on its first failed conn.Write. With no reader left, a streaming turn's 65th send blocked forever β€” and send holds sendMu across that send, whose only escape (ioCtx) is cancelled by teardown, which is itself waiting on WaitForTurns(). Circular wait: the turn never reached its ctx.Err() check even though CancelTurn() had already fired, so the connection goroutine and its s.conns WaitGroup entry leaked for the life of the process and Shutdown() never returned. The read loop and backplane wedged with it on sendMu.

    The writer now keeps draining (discarding) the sink once the socket is dead instead of returning β€” matching the Rust reference, whose unbounded sink_tx can never block a turn on a dead socket.

    Also from the same review:

    • Panic containment. There was no recover() anywhere in go/, and a turn runs on a bare goroutine β€” so one panicking host store/config/hook killed the whole process and dropped every other live connection. A panicking turn now settles as a clean INTERNAL_ERROR with the connection still usable. (A panic inside a tool is still fatal: the engine runs the tool loop on its own recover-less goroutine in smooth-operator-core, so that guard belongs there.) The optional preamble goroutine is guarded too.
    • Nil-deref crash path. TurnRunner.Run called stream.Events() with no nil check, so an AgentExecutor returning (nil, nil) panicked the turn; it now fails the turn cleanly.

    Regression tests: TestClientDisconnectMidStreamDoesNotWedgeTurn (asserts Shutdown() actually returns after an RST mid-burst β€” it hangs without the fix; note -race cannot catch a wedged goroutine) and TestPanickingTurnDoesNotKillTheProcess.

@smooai/smooth-operator-web-chat-example@0.0.101

Patch Changes

  • Updated dependencies [ec1b9c4]
    • @smooai/smooth-operator@1.55.3

@brentrager
brentrager merged commit 17c2160 into main Aug 19, 2026
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.

1 participant