calva

pez 2025-05-05T16:10:42.385129Z

Claude 3.7 can go pretty wild with the REPL. I have had a ton of fun watching it vibe. Haha.

👀 3
đŸ”„ 4
chromalchemy 2025-05-06T18:18:15.756849Z

I was able to run the eval in vscode! Part of my confusion was that if I provided a code line reference to the chat in an eval command, it didnt seem to pick up the code context, and was just trying to eval (in-ns ) but not subsequent code, then the chat would just hang and spin. But i see that if I put the code to eval in the chat box it can do it.

chromalchemy 2025-05-06T18:25:46.758519Z

I was able to load the extension and the stdio server in Windsurf! Thank you accommodating that Some notes : (not that it’s within your support scope). Windsurf seemed not to like the path variables in the config, so I used absolute paths to get past that. Windsurf does not seem to have the individual start/stop server commands, just a global refresh, that seems to hang on error. I have to start the calva backseat server so the port file is there when the mcp servers auto-boot, to avoid an error. Is it okay to start the calva server even before the repl is fully loaded? While the stdio server seems to load. The individual tools show errors like this:

Error: failed to validate tool input schema for tool: evaluate_clojure_code: invalid JSON schema: jsonschema validation failed with '' - at '': allOf failed - at '': validation failed - at '/properties/code': allOf failed - at '/properties/code/description': got null, want string - at '/properties/namespace': allOf failed - at '/properties/namespace/description': got null, want string - at '/properties/replSessionKey': allOf failed - at '/properties/replSessionKey/description': got null, want string.
And it shows 0/4 tools loaded. In the Windsurf (Cascade) chat window, It shows calva as a tool option, but says 0 tools, and the calls dont seems to work. So tldr. Windsurf might be more strict about the schema stuff.

pez 2025-05-06T18:45:25.805139Z

> Is it okay to start the calva server even before the repl is fully loaded? Yes, it’s decoupled until you want to actually use the repl from the server. We could add an option to autostart the server when the extension activates. It is super quick to activate so it would always win.

chromalchemy 2025-05-06T18:51:57.582939Z

Yes that would be helpful.

pez 2025-05-06T18:56:57.227569Z

It’s a very partial implementation of the MCP server. Where it satisfies Anthropic’s test tools and CoPilot is happy. I also have a feeling WindSurf is not a compliant client. Because the Calva MCP server clearly sates the version of the protocol it uses, and WindSurf is still expecting stuff from some other version. That said, it looks like on the error messages that it should be easy to include the descriptions where WindSurf looks for them too. WindSurf was acquired by OpenAI today, for a whooping $3 billion, btw.

pez 2025-05-06T18:58:52.196749Z

Please file issues on the backseat driver repo, @chromalchemy. I’ll forget otherwise. Autostart, and descriptions where WindSurf are looking for them is what I have noted in my head right now. 😃

chromalchemy 2025-05-06T19:32:27.273549Z

Ok thanks for the feedback. Yeah the 3bill is nuts for basically a vscode extension. Someone should pay a fraction of that for Calva! I probably could use VS code proper about as easily, but I kind of wanted a one stop shop to try to understand a supposeldlt best in class process of using an integrated code agent and providing is context and diff approvals, etc. There are so many tools and workflows floated around. It’s a little overwhelming.

pez 2025-05-07T14:46:39.018149Z

So, I’ve tried with Windsurf now. I can’t repro the problem. Possibly because I am using a newer version:

Windsurf Version: 1.8.2
Windsurf Extension Version: 1.46.2
Windsurf Commit: eccc45da0d0c40e57275e0cce7db644c7b1278d8
VSCode OSS Version: 1.99.1
Commit: eccc45da0d0c40e57275e0cce7db644c7b1278d8
Date: 2025-05-07T03:38:46.944Z
Electron: 34.3.2
ElectronBuildId: undefined
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.3.0
It finds 4 tools and seems happy with that. It can also use them, but a thing to note is that it won’t ask for permissions like an MCP client should do. It is full YOLO mode.

pez 2025-05-07T14:49:50.161409Z

Also, Windsurf is pretty disappointing. It doesn’t even see what I have selected in the editor. That was the first thing I added to my original Backset Driver Joyride script over a year ago.

pez 2025-05-07T14:50:30.542629Z

Asking it for help to configure the mcp server it insisted on helping me configure one for CoPilot. 😃

pez 2025-05-07T14:55:32.484089Z

And you can’t configure MCP servers per workspace so I have to use full paths. And makes it totally awkward to have two servers running at the same time.

chromalchemy 2025-05-07T14:57:47.777509Z

The app updated today. Will test and report back. Yea the selection blindess on the eval call threw me off. I found i had to use full paths too (which will break when extension updates). I guess windsurf is playing catch up with mcp stuff? There recent updates seem focused on this area.

pez 2025-05-07T15:00:16.872929Z

When I use the released Backseat Driver it reports 0 tools. Very strange. And very often it just spins when refreshing.

pez 2025-05-07T15:02:08.251679Z

Calva Backseat Driver may be a bit unique in how it supports one project. So maybe Windsurf needs to know that they should support workspace configs. And that they should support the config variables that their AI insist should be used for the config.

pez 2025-05-07T15:10:17.883809Z

calva2 is the released Backseat Driver VSIX, calva is the one running in the development extension host. I haven’t changed anything. 
 I think I have some problem with release build munging!

pez 2025-05-07T19:59:40.575489Z

Releasing a new version now. Where the MCP server actually works. 😃 Also autostart option. Plus some more help with configuring the MCP server.

đŸ”„ 1
chromalchemy 2025-05-05T22:54:47.146109Z

I got it partially working in vscode ! I was able to call clojuredocs from Copilot chat panel. And see the tools listed. When I tried #eval-clojure , the chat hangs. I can get out of it by killing chat request and interrupting current repl evaluations. Note: the docs show "${extensionInstallFolder:betterthantomorrow.calva-backseat-driver}/dist/calva-backseat-driver.js" I believe this filename has changed. I’m a little fuzzy on the recommended process. Do you need to start the Repl and the Calva MCP Socket Server first, butfore activating the MCP server from the config editor?

chromalchemy 2025-05-05T22:56:29.412039Z

When I do connect, I get these errors in calva output:

2025-05-05 18:55:49.494 [info] Starting server calva
2025-05-05 18:55:49.494 [info] Connection state: Starting
2025-05-05 18:55:49.499 [info] Starting server from LocalProcess extension host
2025-05-05 18:55:49.500 [info] Connection state: Starting
2025-05-05 18:55:49.501 [info] Connection state: Running
2025-05-05 18:55:49.608 [warning] [server stderr] [Wrapper] Connected to MCP server on port 52296
2025-05-05 18:55:49.608 [warning] [server stderr] [Wrapper] Raw stdin chunk received: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.99.3"}}}
2025-05-05 18:55:49.608 [warning] [server stderr] 
2025-05-05 18:55:49.608 [warning] [server stderr] [Wrapper] Complete message segment from stdin, sending to socket: {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"roots":{"listChanged":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.99.3"}}}
2025-05-05 18:55:49.613 [warning] [server stderr] [Wrapper] Received from socket: {"jsonrpc":"2.0","id":1,"result":{"serverInfo":{"name":"calva-backseat-driver","version":"0.0.3"},"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"resources":{"listChanged":true}},"instructions":"Use the `get-output-log` tool to tap into output that gives insight in how the program under development is doing, use the `evaluate_clojure_code` tool (if available) to evaluate Clojure/ClojureScript code. There are also tools for getting symbol info and for getting  info.","description":"Gives access to the Calva API, including Calva REPL output, the Clojure REPL connection (if this is enabled in settings), Clojure symbol info, and  lookup. Effectively turning the AI Agent into a Clojure Interactive Programmer."}}
2025-05-05 18:55:49.613 [warning] [server stderr] 
2025-05-05 18:55:49.613 [warning] [server stderr] [Wrapper] Sending to stdout: {"jsonrpc":"2.0","id":1,"result":{"serverInfo":{"name":"calva-backseat-driver","version":"0.0.3"},"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true},"resources":{"listChanged":true}},"instructions":"Use the `get-output-log` tool to tap into output that gives insight in how the program under development is doing, use the `evaluate_clojure_code` tool (if available) to evaluate Clojure/ClojureScript code. There are also tools for getting symbol info and for getting  info.","description":"Gives access to the Calva API, including Calva REPL output, the Clojure REPL connection (if this is enabled in settings), Clojure symbol info, and  lookup. Effectively turning the AI Agent into a Clojure Interactive Programmer."}}
2025-05-05 18:55:49.614 [warning] [server stderr] [Wrapper] Raw stdin chunk received: {"method":"notifications/initialized","jsonrpc":"2.0"}
2025-05-05 18:55:49.614 [warning] [server stderr] 
2025-05-05 18:55:49.614 [warning] [server stderr] [Wrapper] Complete message segment from stdin, sending to socket: {"method":"notifications/initialized","jsonrpc":"2.0"}
2025-05-05 18:55:49.617 [warning] [server stderr] [Wrapper] Raw stdin chunk received: {"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
2025-05-05 18:55:49.618 [warning] [server stderr] 
2025-05-05 18:55:49.618 [warning] [server stderr] [Wrapper] Complete message segment from stdin, sending to socket: {"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
2025-05-05 18:55:49.618 [warning] [server stderr] [Wrapper] Received from socket: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"evaluate_clojure_code","description":null,"inputSchema":{"type":"object","properties":{"code":{"type":"string","description":null},"namespace":{"type":"string","description":null},"replSessionKey":{"type":"string","description":null}},"required":["code","namespace","replSessionKey"],"audience":["user","assistant"],"priority":9}},{"name":"get_symbol_info","description":null,"inputSchema":{"type":"object","properties":{"clojureSymbol":{"type":"string","description":null},"namespace":{"type":"string","description":null},"replSessionKey":{"type":"string","description":null}},"required":["clojureSymbol","replSessionKey","namespace"],"audience":["user","assistant"],"priority":8}},{"name":"get_clojuredocs_info","description":null,"inputSchema":{"type":"object","properties":{"clojureSymbol":{"type":"string","description":null}},"required":["clojureSymbol"],"audience":["user","assistant"],"priority":8}},{"name":"get_repl_output_log","description":null,"inputSchema":{"type":"object","properties":{"sinceLine":{"type":"integer","description":null}},"required":["sinceLine"],"audience":["user","assistant"],"priority":10}}]}}
2025-05-05 18:55:49.618 [warning] [server stderr] 
2025-05-05 18:55:49.618 [warning] [server stderr] [Wrapper] Sending to stdout: {"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"evaluate_clojure_code","description":null,"inputSchema":{"type":"object","properties":{"code":{"type":"string","description":null},"namespace":{"type":"string","description":null},"replSessionKey":{"type":"string","description":null}},"required":["code","namespace","replSessionKey"],"audience":["user","assistant"],"priority":9}},{"name":"get_symbol_info","description":null,"inputSchema":{"type":"object","properties":{"clojureSymbol":{"type":"string","description":null},"namespace":{"type":"string","description":null},"replSessionKey":{"type":"string","description":null}},"required":["clojureSymbol","replSessionKey","namespace"],"audience":["user","assistant"],"priority":8}},{"name":"get_clojuredocs_info","description":null,"inputSchema":{"type":"object","properties":{"clojureSymbol":{"type":"string","description":null}},"required":["clojureSymbol"],"audience":["user","assistant"],"priority":8}},{"name":"get_repl_output_log","description":null,"inputSchema":{"type":"object","properties":{"sinceLine":{"type":"integer","description":null}},"required":["sinceLine"],"audience":["user","assistant"],"priority":10}}]}}
2025-05-05 18:55:49.618 [info] Discovered 4 tools
2025-05-05 18:55:49.618 [warning] Tool evaluate_clojure_code does not have a description. Tools must be accurately described to be called
2025-05-05 18:55:49.618 [warning] Tool get_symbol_info does not have a description. Tools must be accurately described to be called
2025-05-05 18:55:49.618 [warning] Tool get_clojuredocs_info does not have a description. Tools must be accurately described to be called
2025-05-05 18:55:49.618 [warning] Tool get_repl_output_log does not have a description. Tools must be accurately described to be called
2025-05-05 18:55:49.745 [warning] 4 tools have invalid JSON schemas and will be omitted

chromalchemy 2025-05-05T22:57:02.766819Z

Also fyi. The extension doesn’t install in Windsurf because it’s on a slightly older vscode version.

Panel 2025-05-06T05:18:16.153939Z

Trying it out, and it works great with Copilot agent mode.

🙏 1
pez 2025-05-06T05:32:07.318329Z

Which version is Windsurf on?

pez 2025-05-06T05:33:30.099219Z

> and interrupting current repl evaluations The bot should probably have this tool. Even if I doubt a little that it would be smart enough to use it.

pez 2025-05-06T05:57:43.017389Z

> Note: the docs show > "${extensionInstallFolder:betterthantomorrow.calva-backseat-driver}/dist/calva-backseat-driver.js" I believe this filename has changed. Thanks! It hasn’t changed, actually. 😃 The extension was first called calva-mcp-server and then my search/replace got a bit too eager, the correct path is: > ${extensionInstallFolder:betterthantomorrow.calva-backseat-driver}/dist/calva-mcp-server.js (But you obviously have figured that out already.)

pez 2025-05-06T06:00:07.273679Z

I updated the README like so about MCP usage: > For an MCP client to use Calva Backseat Driver, the socket server needs to be started before the stdio wrapper. For now the socket server needs to always be started manually. > 1. Start and connect your REPL > 2. Issue the command: Calva Backseat Driver: Start the MCP socket server > ◩ This will create a port file: ${workspaceFolder}/.calva/mcp-server/port > 3. Have your AI assistant tool start the stdio wrapper from the extension’s install folder in dist/calva-mcp-server.js giveing it the port file as the only argument: > a. ${extensionInstallFolder:betterthantomorrow.calva-backseat-driver}/dist/calva-mcp-server.js ${workspaceFolder}/.calva/mcp-server/port > b. (Those variables work in VS Code, if your assistant don’t speak this language, then you’ll need to replace them with something that works, hard coded paths or whatever.) > 4. Start using your AI Agent with REPL superpowers! >

pez 2025-05-06T06:01:46.551619Z

Except for the messages about missing tool description, that log looks good afaict (hoping it does not end up in your calva ouput, which was a mistypo, right?).

pez 2025-05-06T06:03:26.846589Z

I wonder what’s up with the lacking descriptions... Please check the dev tools console for any clues, @chromalchemy

pez 2025-05-06T06:16:47.865969Z

Grok says that Windsurf is using VS Code 1.98.0. I am trying with that now. VSIX has been built to here: https://github.com/BetterThanTomorrow/calva-backseat-driver/actions I’ll make sure CoPilot is still happy with that and make a new release if so.