Summary
utils/llm/trends.py memory discard/trend detection fails for all users in the pusher service. The error repeats continuously in pusher logs.
Error
ERROR:utils.llm.trends:Error determining memory discard: Completions.parse() got an unexpected keyword argument 'thinking_budget'
Observed in
Pusher service (GKE), utils.llm.trends module, memory discard logic.
Code trace
utils/llm/trends.py:68 calls get_llm('trends').with_structured_output(ExpectedOutput).invoke(prompt)
- In the
basic QoS profile (clients.py:217), 'trends' maps to ('gemini-2.5-flash-lite', 'gemini')
_get_default_client() (clients.py:520) calls _get_or_create_gemini_llm(model, streaming, thinking_budget=0) for all Gemini-routed features
_get_or_create_gemini_llm() (clients.py:492-493) adds thinking_budget to kwargs when model starts with gemini-2.5:
if thinking_budget is not None and model_name.startswith('gemini-2.5'):
kwargs['thinking_budget'] = thinking_budget
- The
thinking_budget kwarg is passed to ChatGoogleGenerativeAI() (clients.py:502), which does not support it — when .with_structured_output() is called, it routes through Completions.parse() which rejects the unknown kwarg
Impact
Memory discard/trend detection fails silently for all users. Every conversation that triggers the memory discard flow in pusher hits this error. The except Exception at trends.py:86-88 catches the error and returns [], so no trends are ever detected.
Repro
Any conversation that triggers the memory discard flow in pusher when the active QoS profile routes trends to a Gemini model.
by AI for @beastoin
Summary
utils/llm/trends.pymemory discard/trend detection fails for all users in the pusher service. The error repeats continuously in pusher logs.Error
Observed in
Pusher service (GKE),
utils.llm.trendsmodule, memory discard logic.Code trace
utils/llm/trends.py:68callsget_llm('trends').with_structured_output(ExpectedOutput).invoke(prompt)basicQoS profile (clients.py:217),'trends'maps to('gemini-2.5-flash-lite', 'gemini')_get_default_client()(clients.py:520) calls_get_or_create_gemini_llm(model, streaming, thinking_budget=0)for all Gemini-routed features_get_or_create_gemini_llm()(clients.py:492-493) addsthinking_budgetto kwargs when model starts withgemini-2.5:thinking_budgetkwarg is passed toChatGoogleGenerativeAI()(clients.py:502), which does not support it — when.with_structured_output()is called, it routes throughCompletions.parse()which rejects the unknown kwargImpact
Memory discard/trend detection fails silently for all users. Every conversation that triggers the memory discard flow in pusher hits this error. The
except Exceptionattrends.py:86-88catches the error and returns[], so no trends are ever detected.Repro
Any conversation that triggers the memory discard flow in pusher when the active QoS profile routes
trendsto a Gemini model.by AI for @beastoin