fix: context compaction summary cut off at 1000 tokens (#33726)

Without Task Model Params set, the compaction summary was capped at 1000 tokens. Reasoning models could spend all of that on thinking and return an empty or cut-off summary, which then replaced the chat's context. The summary request now carries no token limit of its own unless Task Model Params sets one, so the provider's normal limits apply.
This commit is contained in:
Classic298 2026-11-04 22:43:07 +01:00 • committed by GitHub
parent d780d386e6
commit 275e0f40e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -458,9 +458,6 @@ async def _generate_summary(
if not isinstance(task_model_params, dict):
task_model_params = {}
task_model_params = {key: value for key, value in task_model_params.items() if value is not None and value != ''}
task_model_params = task_model_params or {
'max_tokens': models[task_model_id].get('info', {}).get('params', {}).get('max_tokens', 1000)
}
metadata = {
**(request.state.metadata if hasattr(request.state, 'metadata') else {}),