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

Thinking models like DeepSeek V4 Flash can exceed the 120s stream
timeout during long reasoning, causing truncated output and missing
answers. Increase stream timeout to 600s when thinking is enabled,
raise max_tokens floor to 8192, and bump reasoning display max-height.

Closes #326
This commit is contained in:
t8y2
2026-05-19 18:08:08 +08:00
parent d1ad53a6ca
commit 2afcfff4e3
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -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,