datamate-cli.js opens as an editor tab when launching sessions (stdio MCP spawn loses ELECTRON_RUN_AS_NODE)
Bug
When a project's IDE MCP config (.vscode/mcp.json) has a datamate stdio entry written by the VS Code extension, launching an Altimate Code session on a desktop editor can suddenly open dist/datamate-cli.js as an editor tab, and the datamate MCP server fails with MCP error -32000: Connection closed. Once it starts happening, it repeats on every session launch.
Root cause
On desktop editors the IDE entry's command is the editor's Electron binary, and the entry's env block carries ELECTRON_RUN_AS_NODE=1 so the binary runs as Node. datamate_manager add reuses the entry's command + args but drops the env block — both in the immediate spawn and in the entry it persists to .altimate-code/altimate-code.json. Spawned without the flag, Electron boots the editor GUI and opens the script path as a document instead of executing it. The healing sync that would repair the persisted entry only runs on altimate serve boot, never in the TUI or run, so the broken entry never self-repairs for terminal users.
Steps to reproduce
- In a project where the VS Code extension has written a
datamatestdio entry to.vscode/mcp.json(desktop editor, socommandis the Electron binary withenv: {"ELECTRON_RUN_AS_NODE": "1"}), run Altimate Code in the terminal. - Use
datamate_manageroperationaddto connect a datamate. - The CLI file opens as an editor tab and the tool reports
MCP error -32000: Connection closed;.altimate-code/altimate-code.jsonnow has adatamateentry with noenvironmentblock. - Any later session launch in that project re-spawns the broken entry and pops the file again.
Resolved in v0.11.0.