fix: force DeepSeek V4 to use tools, fix API key saving, fix base URL width
This commit is contained in:
1 parent
f216473471
commit
bf12d4ba8b
3 files changed
+26
-21
No files matched your search
@@ -98,7 +98,12 @@ export class DeepSeekHandler implements ApiHandler {
|
||||
stream_options: { include_usage: true },
|
||||
// Only set temperature for non-thinking models
|
||||
...(isDeepSeekThinkingModel ? {} : { temperature: 0 }),
|
||||
...getOpenAIToolParams(tools),
|
||||
// Force tool usage for V4 thinking models to prevent text-only responses
|
||||
...(tools?.length
|
||||
? isDeepSeekThinkingModel
|
||||
? { tools, tool_choice: "required" as const, parallel_tool_calls: false }
|
||||
: getOpenAIToolParams(tools)
|
||||
: { tools: undefined }),
|
||||
})
|
||||
|
||||
const toolCallProcessor = new ToolCallProcessor()
|
||||
|
||||
+17
-17
@@ -1,4 +1,4 @@
|
||||
import { setTimeout as setTimeoutPromise } from "node:timers/promises"
|
||||
import { setTimeout as setTimeoutPromise } from "node:timers/promises"
|
||||
import { ApiHandler, ApiProviderInfo, buildApiHandler } from "@core/api"
|
||||
import { ApiStream } from "@core/api/transform/stream"
|
||||
import { AssistantMessageContent, parseAssistantMessageV2, ToolUse } from "@core/assistant-message"
|
||||
@@ -571,7 +571,7 @@ export class Task {
|
||||
// awaits remoteWorkspaceDetectionPromise before the first flush is scheduled.
|
||||
// If it does fire, we fall back to the local cadence (safe default).
|
||||
Logger.warn(
|
||||
`[Task ${taskId}] getDelayMs called before remote workspace detection settled — using local cadence as fallback`,
|
||||
`[Task ${taskId}] getDelayMs called before remote workspace detection settled 鈥?using local cadence as fallback`,
|
||||
)
|
||||
}
|
||||
return getPresentationCadenceMs(this.isRemoteWorkspaceEnvironment, priority)
|
||||
@@ -1883,23 +1883,23 @@ export class Task {
|
||||
const preferredLanguageRaw = this.stateManager.getGlobalSettingsKey("preferredLanguage")
|
||||
const preferredLanguage = getLanguageKey(preferredLanguageRaw as LanguageDisplay)
|
||||
const languageInstructionMap: Record<string, string> = {
|
||||
"zh-CN": "Simplified Chinese (简体中文)",
|
||||
"zh-TW": "Traditional Chinese (繁體中文)",
|
||||
ja: "Japanese (日本語)",
|
||||
ko: "Korean (한국어)",
|
||||
fr: "French (Français)",
|
||||
"zh-CN": "Simplified Chinese (绠€浣撲腑鏂?",
|
||||
"zh-TW": "Traditional Chinese (绻侀珨涓枃)",
|
||||
ja: "Japanese (鏃ユ湰瑾?",
|
||||
ko: "Korean (頃滉淡鞏?",
|
||||
fr: "French (Fran莽ais)",
|
||||
de: "German (Deutsch)",
|
||||
es: "Spanish (Español)",
|
||||
"pt-BR": "Brazilian Portuguese (Português Brasileiro)",
|
||||
"pt-PT": "Portuguese (Português)",
|
||||
es: "Spanish (Espa帽ol)",
|
||||
"pt-BR": "Brazilian Portuguese (Portugu锚s Brasileiro)",
|
||||
"pt-PT": "Portuguese (Portugu锚s)",
|
||||
it: "Italian (Italiano)",
|
||||
ru: "Russian (Русский)",
|
||||
ar: "Arabic (العربية)",
|
||||
hi: "Hindi (हिन्दी)",
|
||||
cs: "Czech (Čeština)",
|
||||
ru: "Russian (袪褍褋褋泻懈泄)",
|
||||
ar: "Arabic (丕賱毓乇亘賷丞)",
|
||||
hi: "Hindi (啶灌た啶ㄠ啶︵)",
|
||||
cs: "Czech (膶e拧tina)",
|
||||
hu: "Hungarian (Magyar)",
|
||||
pl: "Polish (Polski)",
|
||||
tr: "Turkish (Türkçe)",
|
||||
tr: "Turkish (T眉rk莽e)",
|
||||
en: "English",
|
||||
}
|
||||
const preferredLanguageInstructions =
|
||||
@@ -2424,7 +2424,7 @@ Speak in ${languageInstructionMap[preferredLanguage] || preferredLanguage}.`
|
||||
"mistake_limit_reached",
|
||||
this.api.getModel().id.includes("claude")
|
||||
? `This may indicate a failure in Cline's thought process or inability to use a tool properly, which can be mitigated with some user guidance (e.g. "Try breaking down the task into smaller steps").`
|
||||
: "Cline uses complex prompts and iterative task execution that may be challenging for less capable models. For best results, it's recommended to use Claude 4.5 Sonnet for its advanced agentic coding capabilities.",
|
||||
: "Cline Multi 检测到当前模型出现了连续错误。请尝试将任务拆分为更小的步骤,或检查模型配置。",
|
||||
)
|
||||
if (response === "messageResponse") {
|
||||
// Display the user's message in the chat UI
|
||||
@@ -3119,7 +3119,7 @@ Speak in ${languageInstructionMap[preferredLanguage] || preferredLanguage}.`
|
||||
}
|
||||
|
||||
// Stored the assistant API response immediately after the stream finishes in the same turn
|
||||
// Check if the stream produced any content — either text or native tool calls.
|
||||
// Check if the stream produced any content 鈥?either text or native tool calls.
|
||||
// toolUseHandler may have accumulated tool_use blocks even when useNativeToolCalls is false
|
||||
// (e.g., from Claude Code provider when the model returns native tool_use blocks).
|
||||
const hasAccumulatedToolCalls = toolUseHandler.getAllFinalizedToolUses().length > 0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AutoApprovalSettings, DEFAULT_AUTO_APPROVAL_SETTINGS } from "@shared/AutoApprovalSettings"
|
||||
import { AutoApprovalSettings, DEFAULT_AUTO_APPROVAL_SETTINGS } from "@shared/AutoApprovalSettings"
|
||||
import {
|
||||
ApiProvider,
|
||||
DEFAULT_API_PROVIDER,
|
||||
@@ -272,7 +272,7 @@ const USER_SETTINGS_FIELDS = {
|
||||
shellIntegrationTimeout: { default: 4000 as number },
|
||||
defaultTerminalProfile: { default: "default" as string },
|
||||
terminalOutputLineLimit: { default: 500 as number },
|
||||
maxConsecutiveMistakes: { default: 3 as number },
|
||||
maxConsecutiveMistakes: { default: 5 as number },
|
||||
strictPlanModeEnabled: { default: false as boolean },
|
||||
hooksEnabled: { default: true as boolean },
|
||||
yoloModeToggled: { default: false as boolean },
|
||||
@@ -281,7 +281,7 @@ const USER_SETTINGS_FIELDS = {
|
||||
subagentsEnabled: { default: false as boolean },
|
||||
clineWebToolsEnabled: { default: true as boolean },
|
||||
worktreesEnabled: { default: false as boolean },
|
||||
preferredLanguage: { default: "Simplified Chinese - 简体中文" as string },
|
||||
preferredLanguage: { default: "Simplified Chinese - ¼òÌåÖÐÎÄ" as string },
|
||||
mode: { default: "act" as Mode },
|
||||
focusChainSettings: { default: DEFAULT_FOCUS_CHAIN_SETTINGS as FocusChainSettings },
|
||||
customPrompt: { default: undefined as "compact" | undefined },
|
||||
|
||||
Reference in new issue
Block a user