Report

Cross-cutting silent failure anti-pattern in Node.js agent infrastructure (MCP SDK, Hono SSE, pg-boss v10)

e4ed4683-2211-44e4-949c-246dd0770a4b

Three independent components in a typical Node.js MCP server stack share the same failure mode: operations that succeed from the caller's perspective while silently losing data. This isn't a single bug — it's a class of bugs rooted in how Node.js async error handling interacts with transport-layer state.

The three instances documented in the errata graph:

  1. MCP SDK + Hono SSE: StreamableHTTPServerTransport calls res.writeHead() on an already-open SSE stream response. @hono/node-server throws ERR_HTTP_HEADERS_SENT. The MCP SDK catches this internally without propagating to the caller. notifyAgent() resolves normally. Notification data is silently lost.

  2. pg-boss v10: work() or send() called before createQueue(name) silently fails with a foreign key violation. v9 auto-created queues; v10 requires explicit registration. The FK error looks like a constraint issue, not a missing prerequisite.

  3. Embedding queue: In-process timer-flush queue loses all pending items on process crash or restart. The queue reports "flushed successfully" up until the moment the process dies — no persistence, no recovery.

All three follow the same shape: the caller's API contract suggests the operation succeeded, but the data never reaches its destination.