nrepl

borkdude 2025-08-28T14:44:03.764419Z

> https://clojurians.slack.com/archives/C17JYSA3H/p1713102482119679?thread_ts=1713032441.875029&cid=C17JYSA3H what is "session-closed", why do I need to send it to make vim-fireplace believe the session is closed, where is this documented?

borkdude 2025-08-28T18:39:10.167239Z

it's middleware so not part of the nREPL spec per se, I guess?

2025-08-28T18:40:43.410409Z

yeah, but it is a pretty ancient part of nrepl, so wouldn't be surprised if everything just assumes it is there

borkdude 2025-08-28T18:49:56.884299Z

got it, thanks

oyakushev 2025-08-28T20:55:58.195239Z

The session middleware is the foundational part of nrepl, so it's not optional. Everything depends upon it, including eval.

borkdude 2025-08-28T20:57:05.000269Z

I'm coming at this as an implementor of a non JVM Clojure nREPL server. If something is essential, it should imo be documented as part of the protocol

oyakushev 2025-08-28T20:57:43.348389Z

PRs are welcome :)

❤️ 1
bozhidar 2025-08-29T04:25:35.279549Z

But it is documented - https://nrepl.org/nrepl/1.3/ops.html#close

bozhidar 2025-08-29T04:26:49.342079Z

There’s no “session-closed” per se - you use “clone” to create a session and “close” to destroy it.

borkdude 2025-08-29T06:19:01.512529Z

Ok so when a client relies on “session-closed” that’s not according to the spec then right? Why even send this value then?

bozhidar 2025-08-29T07:14:24.359819Z

I guess that’s legacy, as it’s the first time I hear about it.

bozhidar 2025-08-29T07:14:41.521439Z

Fireplace was an early adopter of nREPL. Let me check the code myself.

bozhidar 2025-08-29T07:20:06.395549Z

I see that the success response for close is the set {:done :session-closed} and I guess that’s the part we failed to document properly. Seems reasonable for the clients to check that a session actually got closed.

bozhidar 2025-08-29T07:21:24.144629Z

Funny enough, I never bothered to check for this in CIDER and I just assume that if the response had :done in it the session got closed, which is not great, as you can get a “done” together with some error.

borkdude 2025-08-29T07:46:30.770999Z

yeah, I've never ran into this except for vim fireplace :)

borkdude 2025-08-29T07:46:44.944439Z

ok great we cleared this up, thanks @bozhidar!

borkdude 2025-08-29T10:14:53.448159Z

I created an issue for it at least now: https://github.com/nrepl/nrepl/issues/376

bozhidar 2025-08-29T11:50:11.537639Z

Thanks!