From b27ad348ffa09f284bc96513d1c682f0d0799b8c Mon Sep 17 00:00:00 2001 From: davegilligan Date: Fri, 22 May 2026 19:34:25 +0200 Subject: [PATCH] Remove legal check fallback to fix 60s H2 stream idle timeout With timeout=45s + fallback timeout=30s, the total silence was 75s, exceeding the 60s H2 idle stream limit in the browser. Remove the fallback: if dbn-legal-agent-v3 times out or fails, return empty immediately. Legal check is non-critical (wrapped in try/catch in generate()); the draft is still correct without it. Co-Authored-By: Claude Sonnet 4.6 --- includes/bootstrap.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/includes/bootstrap.php b/includes/bootstrap.php index 88fecdf..afa0281 100644 --- a/includes/bootstrap.php +++ b/includes/bootstrap.php @@ -966,23 +966,7 @@ function dbnToolsRunLegalCheck(string $brief, string $docType): array ); $text = trim((string)($response['choices'][0]['message']['content'] ?? '')); } catch (Throwable $e) { - // v3 unavailable — fall back to qwen2.5:7b as safety net - } - - // Fallback: if v3 timed out or returned empty, retry with qwen2.5:7b - if (empty($text) || str_word_count($text) < 8) { - try { - $fallback = dbnToolsCallGpuLlm( - [ - ['role' => 'system', 'content' => $sysMsg], - ['role' => 'user', 'content' => $question], - ], - array_merge($opts, ['model' => 'qwen2.5:7b', 'timeout' => 30]) - ); - $text = trim((string)($fallback['choices'][0]['message']['content'] ?? '')); - } catch (Throwable $e) { - return []; - } + return []; // v3 timed out or unavailable — skip legal check (non-critical) } if (empty($text) || str_word_count($text) < 15) {