Problem
There are a couple of API correctness issues that can lead to runtime failures or degraded responses:
/api/ask can fail because user_id is referenced before assignment.
ask_internal() clears sources after orchestration, so any returned citations/tool sources are dropped.
Scope
Track a focused set of fixes as small, reviewable PRs:
Why this matters
These changes improve correctness and reliability while keeping risk low by scoping each PR to one concern.
Problem
There are a couple of API correctness issues that can lead to runtime failures or degraded responses:
/api/askcan fail becauseuser_idis referenced before assignment.ask_internal()clearssourcesafter orchestration, so any returned citations/tool sources are dropped.Scope
Track a focused set of fixes as small, reviewable PRs:
user_idin/api/askand preservesourcesreturned by orchestrationWhy this matters
These changes improve correctness and reliability while keeping risk low by scoping each PR to one concern.