实现画布 Agent 请求停止交互

为每轮消息请求注入 AbortController 并停止当前 HTTP 请求

停止后在 isAborting 生命周期内静默刷新并阻止重复发送

补充 AbortError、客户端 signal 与面板状态回归测试
This commit is contained in:
2026-07-22 17:37:54 +08:00
parent ae9502d9ed
commit 98daad90c0
7 changed files with 337 additions and 64 deletions
+4 -5
View File
@@ -405,11 +405,10 @@ function shouldRetryResponse(
export function isAbortError(error: unknown) {
return (
error instanceof Error &&
(error.name === 'AbortError' ||
(typeof DOMException !== 'undefined' &&
error instanceof DOMException &&
error.name === 'AbortError'))
typeof error === 'object' &&
error !== null &&
'name' in error &&
error.name === 'AbortError'
);
}