Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions apps/desktop/electron-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ const config: Configuration = {
to: "resources/migrations",
filter: ["**/*"],
},
// Claude Code binary - bundled for AI chat functionality
{
// biome-ignore lint/suspicious/noTemplateCurlyInString: electron-builder variable interpolation
from: "resources/bin/${platform}-${arch}",
to: "bin",
filter: ["**/*"],
},
// Claude Code binary - no longer bundled; the SDK resolves it at runtime
// {
// // biome-ignore lint/suspicious/noTemplateCurlyInString: electron-builder variable interpolation
// from: "resources/bin/${platform}-${arch}",
// to: "bin",
// filter: ["**/*"],
// },
],

files: [
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"copy:native-modules": "bun run scripts/copy-native-modules.ts",
"download:claude": "bun run scripts/download-claude-binary.ts",
"upgrade:claude": "bun run scripts/upgrade-claude-binary.ts",
"prebuild": "bun run clean:dev && bun run compile:app && bun run copy:native-modules && bun run download:claude",
"prebuild": "bun run clean:dev && bun run compile:app && bun run copy:native-modules",
"build": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never",
"prepackage": "bun run copy:native-modules && bun run download:claude",
"prepackage": "bun run copy:native-modules",
"package": "electron-builder --config electron-builder.ts",
"install:deps": "electron-builder install-app-deps",
"release": "electron-builder --publish always",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { existsSync } from "node:fs";
import { join } from "node:path";
import {
createPermissionRequest,
Expand All @@ -10,19 +11,30 @@ import type { SessionStore } from "../session-store";
import type { PermissionRequestEvent } from "./session-events";
import type { ActiveSession } from "./session-types";

function getClaudeBinaryPath(): string {
function getClaudeBinaryPath(): string | null {
let binaryPath: string;
if (app.isPackaged) {
return join(process.resourcesPath, "bin", "claude");
binaryPath = join(process.resourcesPath, "bin", "claude");
} else {
const platform = process.platform;
const arch = process.arch;
binaryPath = join(
app.getAppPath(),
"resources",
"bin",
`${platform}-${arch}`,
"claude",
);
}
const platform = process.platform;
const arch = process.arch;
return join(
app.getAppPath(),
"resources",
"bin",
`${platform}-${arch}`,
"claude",
);

if (!existsSync(binaryPath)) {
console.warn(
`[chat/agent] Claude binary not found at ${binaryPath} — will rely on SDK to resolve`,
);
return null;
}

return binaryPath;
}

export interface ResolvePermissionInput {
Expand Down Expand Up @@ -56,12 +68,15 @@ export class AgentExecution {
onChunk,
}: ExecuteAgentInput): Promise<void> {
const agentEnv = buildClaudeEnv();
const claudeBinaryPath = getClaudeBinaryPath();

await executeAgent({
sessionId,
prompt,
cwd: session.cwd,
pathToClaudeCodeExecutable: getClaudeBinaryPath(),
...(claudeBinaryPath && {
pathToClaudeCodeExecutable: claudeBinaryPath,
}),
env: agentEnv,
model: session.model,
permissionMode: session.permissionMode ?? "default",
Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.