StreamCoordinator.failPending

Fail a single still-pending outbound request (sessionToken, id) with error and wake its awaiting task immediately (mirrors DuplexCoordinator.failPending, but targeted at one waiter). Used when the GET SSE listener a server->client request was delivered on disconnects before the client could respond: rather than letting the awaiter block for the full timeout, it is released promptly with an McpException. Unknown keys are ignored.

The waiter is left in the table: cleanup is the awaiter's responsibility via await/awaitLive's scope (exit) waiters.remove(key). Callers MUST only fail keys that have (or will have) a live awaiter, which holds for the sole caller removeListenerLocked: every id it fails was registered in requestOnSession immediately before its awaitLive, and an id whose delivery failed is dropped via cancel rather than reaching this path. A failed waiter that is awaited only afterwards still observes done/error (see the fail-then-await unittest).

class StreamCoordinator
@safe
void
failPending
(
long id
,,
string sessionToken = ""
)