dispatch

private fun dispatch(req: JsonObject, reqSession: String, ex: HttpExchange): JsonObject?

Return

the JSON-RPC response object, or null when nothing should be sent back — a notification, or a request whose client executeCode found gone.

A notification is a request with no id, regardless of method — hence the single gate at the bottom rather than one per branch: an id-less tools/call must execute-but-not-reply like any other. ex arrives with its headers already sent (sendHeaders); a notification's 202 is closed, so only a request passes it on.