Skip to content

bug: thinking_budget kwarg passed to Completions.parse() crashes memory discard in pusher #7898

Closed

Description

@beastoin

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

  1. utils/llm/trends.py:68 calls get_llm('trends').with_structured_output(ExpectedOutput).invoke(prompt)
  2. In the basic QoS profile (clients.py:217), 'trends' maps to ('gemini-2.5-flash-lite', 'gemini')
  3. _get_default_client() (clients.py:520) calls _get_or_create_gemini_llm(model, streaming, thinking_budget=0) for all Gemini-routed features
  4. _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
  5. 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

Activity

  1. added
    bug
    on Jun 13, 2026
  2. added
    intelligence
    p2
    maintainer
    on Jun 15, 2026
  3. added a commit that references this issue on Jul 7, 2026
    8f826e2
  4. added a commit that references this issue on Jul 7, 2026
    3852c86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugintelligencemaintainerp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions