ui: fix stop and reasoning skip in single-model mode#25084
ui: fix stop and reasoning skip in single-model mode#25084ServeurpersoCom wants to merge 3 commits into
Conversation
stop cancel (single-model only): stopGenerationForChat read the live model dropdown instead of a frozen identity to build the DELETE key. in single-model the POST opens the session under conv_id alone while the stop appended ::model, so the key missed and generation ran to eos; router matched by accident and already worked. now effectiveModel is frozen on every write and the dropdown is consulted only in router mode, so the key matches the POST in both modes. reasoning skip (single-model and router): the continue flow never wired onCompletionId, so after a stop and continue the message kept the dead completion id and the skip control hit a slot that no longer existed. record the fresh id on every continue so the skip targets the live slot.
|
On my end, the server still keeps generating if I click on the stop button during reasoning. Here is the log after click the stop button multiple times: |
|
Thanks for testing. I'm checking the conversation IDs. Something is amiss. This PR needs to resolve all those cases. |
stop and reasoning control silently no-op when the id does not match a live session or completion, which makes a client side id mismatch impossible to diagnose from the logs. evict_and_cancel now warns with the requested conv_id and the list of live session keys when nothing matches, and logs an info line when a stop is accepted. the control task warns with the requested completion id and the live processing cmpl_ids when no slot owns it, warns when reasoning control was never armed, and logs an info line when reasoning_end is accepted. the router stop proxy warns when no child owns the conv_id and when the child reports no live session. no behavior change, observability only.
|
Backend instrumentation to debug the frontend. (Can be reverted or improved, this will be very useful with the right level of verbosity in case of UI regression.) It's an edge case: |
the stop path derived the model lazily and fell back to the live dropdown when the frozen streaming state held none. when the dropdown was empty while the POST had used a resolved model, the DELETE key dropped the ::model suffix, missed the live session, and generation drained to eos. seed the streaming state with effectiveModel at t0, before the request, so the frozen identity is present from the first millisecond. the stop now reads that identity only, with no dropdown fallback that can diverge from the POST. the DELETE key equals the X-Conversation-Id sent at POST in both single-model and router mode.
Overview
Two fixes here :
Single-model: pressing Stop while the model is thinking now actually stops generation. Before, it kept running in the background until the end and only stopped late, and a page refresh got stuck on "Connecting to Server" until it finished.
Single-model and router: the Skip reasoning button now keeps working after you Stop then Continue. Before, that sequence left it dead and clicking it did nothing.
Additional information
Fixes #25055
Requirements