fix sse HANGING tasks
This commit is contained in:
42
RETRIEX_SSE_RUNNING_RECONNECT_FINALIZE_FIX_README.md
Normal file
42
RETRIEX_SSE_RUNNING_RECONNECT_FINALIZE_FIX_README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# RetrieX SSE running reconnect / final cleanup fix
|
||||
|
||||
Patch-only fix for the streamed answer UI after the job-based SSE flow.
|
||||
|
||||
## Problem
|
||||
|
||||
After introducing stream jobs, an EventSource reconnect to an already running job could receive:
|
||||
|
||||
```text
|
||||
retry: 15000
|
||||
|
||||
: duplicate-or-finished-stream
|
||||
|
||||
event: done
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
Because `running` jobs were treated like harmless duplicate/finished streams, the browser could finalize an incomplete answer as if it had completed successfully. In addition, the final `done` cleanup still used the streaming cleanup path, which can keep the last `.think` block visible.
|
||||
|
||||
## Changes
|
||||
|
||||
- `running` duplicate/reconnect streams are no longer silently closed as successful `[DONE]` completions.
|
||||
- Only already `completed` duplicate streams are silently closed with `done`.
|
||||
- A reconnect to a still-running job now follows the existing explicit error path, so the UI can show a clear interruption message instead of silently accepting a partial answer.
|
||||
- Final stream completion now removes all `.think` blocks and the loader class.
|
||||
|
||||
## Changed files
|
||||
|
||||
- `src/Controller/AskSseController.php`
|
||||
- `public/assets/js/base.js`
|
||||
|
||||
## After installing
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
php bin/console cache:clear
|
||||
php bin/console mto:agent:config:validate
|
||||
php bin/console mto:agent:regression:test
|
||||
```
|
||||
|
||||
Also hard-refresh the browser or clear browser cache because `public/assets/js/base.js` is client-side JavaScript.
|
||||
Reference in New Issue
Block a user