fix(langgraph): pushMessage emits on the streamEvents v3 messages channel (#2747)
## Problem
`pushMessage` looks up the callback handler by the name
`StreamMessagesHandler`. `streamEvents({ version: "v3" })` registers
`StreamProtocolMessagesHandler` instead, so on the v3 path (which
`@langchain/langgraph-api` uses to serve run streams) manually pushed
messages never reach the live `messages` channel. The state-persistence
half still runs, so the pushed messages only appear in `values`
snapshots at node end — the live emission is lost silently.
Reproduction: a node that calls `pushMessage(new AIMessage({ id: "1",
content: "First" }), config)` emits nothing on the `messages` channel
under `streamEvents(..., { version: "v3" })`, while the same graph under
`graph.stream(..., { streamMode: "messages" })` emits the tuple as
documented.
## Fix
`pushMessage` now finds either handler and delivers through the v3
handler's `emitFinalMessage` (made public, mirroring the classic
handler's public `_emit`), producing the standard `message-start` /
content block / `message-finish` sequence. No behavior change on the
classic path.
## Test
Adds a regression test to `message.test.ts`: pushed message must surface
as `message-start`/`message-finish` events on the v3 protocol stream.
Red on current main, green with the fix; the four existing tests still
pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Christian Bromann <git@bromann.dev>
Co-authored-by: Marek Pejcoch <marek@brightsync.ai>
Co-authored-by: Christian Bromann <git@bromann.dev> T
t3s7r committed
5ce7f42a345f826d568c07e7a9e5783ed1dce95e
Parent: 3609b35
Committed by GitHub <noreply@github.com>
on 8/26/2026, 9:53:38 PM