mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-26 04:18:29 +00:00
fix(ai-assistant): 修复 SSE 连接失败时状态未正确更新的问题
当 SSE 连接一开始就失败时,响应状态保持 'waiting' 而非 'streaming', 导致 onFailed 回调不会更新状态,UI 一直显示 loading。 现在同时处理 'streaming' 和 'waiting' 状态,并标记为错误状态显示失败提示。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cb5e7e2cc7
commit
07b99c6e75
@ -945,8 +945,8 @@ export default {
|
||||
}
|
||||
}, () => {
|
||||
// SSE 连接失败(重试次数用完)时的回调
|
||||
if (responseEntry && responseEntry.status === 'streaming') {
|
||||
responseEntry.status = 'completed';
|
||||
if (responseEntry && ['streaming', 'waiting'].includes(responseEntry.status)) {
|
||||
this.markResponseError(responseEntry, this.$L('连接失败,请重试'));
|
||||
}
|
||||
this.releaseSSEClient(sse);
|
||||
this.saveCurrentSession();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user