diff --git a/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch b/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch new file mode 100644 index 0000000000..5e93b9b104 --- /dev/null +++ b/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch @@ -0,0 +1,31 @@ +diff --git a/sdk.mjs b/sdk.mjs +index e2dbafb4e2faa1bf2b6b02f0009a2b9bbf57c757..ea333ae8c69fcd27a9f2d89b3dbfc0a3e4e4dec4 100755 +--- a/sdk.mjs ++++ b/sdk.mjs +@@ -6213,7 +6213,7 @@ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) { + } + + // src/transport/ProcessTransport.ts +-import { spawn } from "child_process"; ++import { fork } from "child_process"; + import { createInterface } from "readline"; + + // src/utils/fsOperations.ts +@@ -6452,13 +6452,12 @@ class ProcessTransport { + throw new ReferenceError(errorMessage); + } + const isNative = isNativeBinary(pathToClaudeCodeExecutable); +- const spawnCommand = isNative ? pathToClaudeCodeExecutable : executable; +- const spawnArgs = isNative ? args : [...executableArgs, pathToClaudeCodeExecutable, ...args]; +- this.logDebug(isNative ? `Spawning Claude Code native binary: ${pathToClaudeCodeExecutable} ${args.join(" ")}` : `Spawning Claude Code process: ${executable} ${[...executableArgs, pathToClaudeCodeExecutable, ...args].join(" ")}`); + const stderrMode = env.DEBUG || stderr ? "pipe" : "ignore"; +- this.child = spawn(spawnCommand, spawnArgs, { ++ ++ this.logDebug(`Forking Claude Code Node.js process: ${pathToClaudeCodeExecutable} ${args.join(" ")}`); ++ this.child = fork(pathToClaudeCodeExecutable, args, { + cwd, +- stdio: ["pipe", "pipe", stderrMode], ++ stdio: stderrMode === "pipe" ? ["pipe", "pipe", "pipe", "ipc"] : ["pipe", "pipe", "ignore", "ipc"], + signal: this.abortController.signal, + env + }); diff --git a/package.json b/package.json index 832f9c183d..18408e4a74 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "release:aicore": "yarn workspace @cherrystudio/ai-core version patch --immediate && yarn workspace @cherrystudio/ai-core npm publish --access public" }, "dependencies": { - "@anthropic-ai/claude-code": "1.0.118", + "@anthropic-ai/claude-code": "patch:@anthropic-ai/claude-code@npm%3A1.0.118#~/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch", "@libsql/client": "0.14.0", "@libsql/win32-x64-msvc": "^0.4.7", "@napi-rs/system-ocr": "patch:@napi-rs/system-ocr@npm%3A1.0.2#~/.yarn/patches/@napi-rs-system-ocr-npm-1.0.2-59e7a78e8b.patch", diff --git a/src/renderer/src/components/Popups/agent/SessionModal.tsx b/src/renderer/src/components/Popups/agent/SessionModal.tsx index 59f18a1dc2..82e07dab19 100644 --- a/src/renderer/src/components/Popups/agent/SessionModal.tsx +++ b/src/renderer/src/components/Popups/agent/SessionModal.tsx @@ -29,12 +29,9 @@ import { FormEvent, ReactNode, useCallback, useEffect, useMemo, useRef, useState import { useTranslation } from 'react-i18next' import { ErrorBoundary } from '../../ErrorBoundary' -import { ModelOption } from './shared' const logger = loggerService.withContext('SessionAgentPopup') -type Option = ModelOption - type AgentWithTools = AgentEntity & { tools?: Tool[] } type SessionWithTools = AgentSessionEntity & { tools?: Tool[] } diff --git a/src/renderer/src/services/ProviderService.ts b/src/renderer/src/services/ProviderService.ts index 5068ad8d97..2d10581eb9 100644 --- a/src/renderer/src/services/ProviderService.ts +++ b/src/renderer/src/services/ProviderService.ts @@ -13,7 +13,7 @@ export function getProviderName(model?: Model) { } export function getProviderNameById(pid: string) { - const provider = store.getState().llm.providers.find((p) => p.id === pid) + const provider = getStoreProviders().find((p) => p.id === pid) if (provider) { return getFancyProviderName(provider) } else { diff --git a/yarn.lock b/yarn.lock index 2d14623ea8..375746207e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -414,6 +414,35 @@ __metadata: languageName: node linkType: hard +"@anthropic-ai/claude-code@patch:@anthropic-ai/claude-code@npm%3A1.0.118#~/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch": + version: 1.0.118 + resolution: "@anthropic-ai/claude-code@patch:@anthropic-ai/claude-code@npm%3A1.0.118#~/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch::version=1.0.118&hash=d20711" + dependencies: + "@img/sharp-darwin-arm64": "npm:^0.33.5" + "@img/sharp-darwin-x64": "npm:^0.33.5" + "@img/sharp-linux-arm": "npm:^0.33.5" + "@img/sharp-linux-arm64": "npm:^0.33.5" + "@img/sharp-linux-x64": "npm:^0.33.5" + "@img/sharp-win32-x64": "npm:^0.33.5" + dependenciesMeta: + "@img/sharp-darwin-arm64": + optional: true + "@img/sharp-darwin-x64": + optional: true + "@img/sharp-linux-arm": + optional: true + "@img/sharp-linux-arm64": + optional: true + "@img/sharp-linux-x64": + optional: true + "@img/sharp-win32-x64": + optional: true + bin: + claude: cli.js + checksum: 10c0/6a6261562c25ceb83b7c8c976fddadb782f03e50bb73580446f0ca49ac8e9f9a6158fa1b5bf93f070be49bf3a0e8e06adefdea49f71706258e4c9200a3fa52e7 + languageName: node + linkType: hard + "@anthropic-ai/sdk@npm:>=0.50.3 <1": version: 0.56.0 resolution: "@anthropic-ai/sdk@npm:0.56.0" @@ -14162,7 +14191,7 @@ __metadata: "@ai-sdk/mistral": "npm:^2.0.14" "@ai-sdk/perplexity": "npm:^2.0.9" "@ant-design/v5-patch-for-react-19": "npm:^1.0.3" - "@anthropic-ai/claude-code": "npm:1.0.118" + "@anthropic-ai/claude-code": "patch:@anthropic-ai/claude-code@npm%3A1.0.118#~/.yarn/patches/@anthropic-ai-claude-code-npm-1.0.118-bbf4e9e59f.patch" "@anthropic-ai/sdk": "npm:^0.41.0" "@anthropic-ai/vertex-sdk": "patch:@anthropic-ai/vertex-sdk@npm%3A0.11.4#~/.yarn/patches/@anthropic-ai-vertex-sdk-npm-0.11.4-c19cb41edb.patch" "@aws-sdk/client-bedrock": "npm:^3.840.0"