Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(ai): extend timeout and token budget for thinking models

t8y22afcfff4e38f
diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue
index 10ccfa65e1..8f18b1601c 100644
--- a/apps/desktop/src/components/editor/AiAssistant.vue
+++ b/apps/desktop/src/components/editor/AiAssistant.vue
@@ -738,7 +738,7 @@ const messageRenderer = createAiMessageRenderer({ markdown: formatInlineText });
<div
class="overflow-hidden transition-all duration-200 ease-in-out"
:style="{
- maxHeight: expandedReasoning.has(i) || msg.isThinking ? '2000px' : '0px',
+ maxHeight: expandedReasoning.has(i) || msg.isThinking ? '20000px' : '0px',
opacity: expandedReasoning.has(i) || msg.isThinking ? '1' : '0',
}"
>
diff --git a/apps/desktop/src/lib/ai.ts b/apps/desktop/src/lib/ai.ts
index 0a647b3a8e..87dcd4a373 100644
--- a/apps/desktop/src/lib/ai.ts
+++ b/apps/desktop/src/lib/ai.ts
@@ -94,6 +94,7 @@ export async function runAiStream(
const sid = sessionId || uuid();
const params = actionParams(input.action);
+ const maxTokens = input.config.enableThinking ? Math.max(params.maxTokens, 8192) : params.maxTokens;
await api.aiStream(
sid,
@@ -101,7 +102,7 @@ export async function runAiStream(
config: input.config,
systemPrompt,
messages,
- maxTokens: params.maxTokens,
+ maxTokens,
temperature: params.temperature,
},
(chunk) => {
diff --git a/crates/dbx-core/src/ai.rs b/crates/dbx-core/src/ai.rs
index 3bea21dd25..adf1d8d20a 100644
--- a/crates/dbx-core/src/ai.rs
+++ b/crates/dbx-core/src/ai.rs
@@ -504,7 +504,8 @@ pub async fn stream(
) -> Result<(), String> {
validate_config(&request.config)?;
- let client = build_ai_http_client(&request.config, 120)?;
+ let stream_timeout = if request.config.enable_thinking { 600 } else { 120 };
+ let client = build_ai_http_client(&request.config, stream_timeout)?;
match request.config.provider {
AiProvider::Claude => stream_claude(&client, session_id, request, cancelled, &on_chunk).await,