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 <noreply@anthropic.com>
This commit is contained in:
+1
-17
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user