fix: 等待云端智能体资源释放后续接工具结果
This commit is contained in:
@@ -92,6 +92,20 @@ export function teacherCloudTransport(account: TeacherAccount): TeacherCloudTran
|
||||
if (!response.ok) {
|
||||
const data = object(await response.json());
|
||||
const detail = data.detail;
|
||||
const conflict = detail && typeof detail === 'object' && !Array.isArray(detail)
|
||||
? object(detail) : undefined;
|
||||
const pendingRun = /^\/runs\/([^/]+)\/tool-results$/.exec(path)?.[1];
|
||||
if (signal && response.status === 409 && pendingRun && body !== undefined
|
||||
&& conflict?.code === 'run_busy'
|
||||
&& conflict.active_run_id === decodeURIComponent(pendingRun)
|
||||
&& conflict.active_run_status === 'interrupted') {
|
||||
// Yuxi commits the interrupt before releasing its runtime. Keep the
|
||||
// same result batch while that parent still owns the cleanup fence.
|
||||
// The question's original deadline/cancellation bounds this wait.
|
||||
await delay(500, undefined, { signal });
|
||||
attempt--;
|
||||
continue;
|
||||
}
|
||||
const message =
|
||||
typeof detail === 'string'
|
||||
? detail
|
||||
|
||||
Reference in New Issue
Block a user