Skip to content

Commit 524b33d

Browse files
committed
fix(server): Claude's commands no longer run Electron apps as Node
The desktop runs the server with ELECTRON_RUN_AS_NODE=1, and the Claude process env copied it, so every command Claude ran inherited it. Starting an Electron app from there (T3 Code itself, VS Code) ran it as Node, which rejects Chromium flags with "bad option" and exits. Drop it like the terminal manager already does.
1 parent ac8dce0 commit 524b33d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/server/src/provider/Drivers/ClaudeHome.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ it.layer(NodeServices.layer)("ClaudeHome", (it) => {
6060
});
6161

6262
it.effect(
63-
"drops the launching Claude session and labels processes t3-code unless overridden",
63+
"drops the launching Claude session and Electron's run-as-Node flag, and labels processes t3-code unless overridden",
6464
() =>
6565
Effect.gen(function* () {
6666
const fileSystem = yield* FileSystem.FileSystem;
@@ -72,6 +72,7 @@ it.layer(NodeServices.layer)("ClaudeHome", (it) => {
7272
CLAUDE_CODE_SESSION_ID: "host-session",
7373
CLAUDE_CODE_MESSAGING_SOCKET: "/tmp/host-claude.sock",
7474
CLAUDE_EFFORT: "high",
75+
ELECTRON_RUN_AS_NODE: "1",
7576
KEEP: "1",
7677
};
7778
const instance = [

‎apps/server/src/provider/Drivers/ClaudeHome.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export const mergeClaudeProcessEnvironment = Effect.fn("mergeClaudeProcessEnviro
7676
CLAUDE_CODE_ENTRYPOINT: "t3-code",
7777
};
7878
for (const name of CLAUDE_HOST_SESSION_VARIABLES) delete baseEnvironment[name];
79+
// The desktop runs the server as Node through Electron. Commands Claude runs inherit its env, so
80+
// an Electron app they start (T3 Code itself, VS Code) would run as Node and exit.
81+
delete baseEnvironment.ELECTRON_RUN_AS_NODE;
7982
const environment = yield* mergeProviderInstanceEnvironment(instanceEnvironment, baseEnvironment);
8083
const settingsEntrypoint = (yield* readClaudeSettingsEnv(config, undefined, environment))
8184
.CLAUDE_CODE_ENTRYPOINT;

0 commit comments

Comments
 (0)