fix gemini truncated reply (max_tokens 16->64) and suppress GeneratorExit on client disconnect

This commit is contained in:
Roland Tannous 2026-03-30 06:22:30 +00:00
commit f1f5fa97a9
2 changed files with 3 additions and 1 deletions

View file

@ -967,6 +967,8 @@ async def _proxy_to_external_provider(
):
yield f"{line}\n\n"
yield "data: [DONE]\n\n"
except GeneratorExit:
pass
except Exception as exc:
logger.error("external_provider.stream_error", error = str(exc))
finally:

View file

@ -512,7 +512,7 @@ class TestVisionInference:
],
}],
"stream": True,
"max_tokens": 16,
"max_tokens": 64,
"provider_type": provider_type,
"external_model": model,
"encrypted_api_key": encrypted,