feat(dogfood-wave1): Studio retries, Chat error, LLM gateway, kill snapshot, topbar cleanup (#14)
This commit was merged in pull request #14.
This commit is contained in:
+15
-9
@@ -103,17 +103,23 @@ export const wizardApi = {
|
||||
*/
|
||||
async applyBatch(_flowKey: string, ops: BatchOp[], _actor: Actor | null, signal?: AbortSignal) {
|
||||
if (!ops.length) return { applied: 0 };
|
||||
const res = await fetch(`${api.config.baseUrl}/api/ea2/apply-batch`, {
|
||||
method: "POST",
|
||||
headers: authHeaders(),
|
||||
body: JSON.stringify({ request_id: newRequestId(), ops }),
|
||||
signal,
|
||||
});
|
||||
if (!res.ok) {
|
||||
const body = JSON.stringify({ request_id: newRequestId(), ops });
|
||||
const transient = new Set([502, 503, 504]);
|
||||
let lastErr = "";
|
||||
for (let attempt = 0; attempt < 3; attempt++) {
|
||||
const res = await fetch(`${api.config.baseUrl}/api/ea2/apply-batch`, {
|
||||
method: "POST",
|
||||
headers: authHeaders(),
|
||||
body,
|
||||
signal,
|
||||
});
|
||||
if (res.ok) return res.json();
|
||||
const detail = await res.text().catch(() => "");
|
||||
throw new Error(`applyBatch ${res.status}: ${detail.slice(0, 200)}`);
|
||||
lastErr = `applyBatch ${res.status}: ${detail.slice(0, 200)}`;
|
||||
if (!transient.has(res.status)) break;
|
||||
await new Promise((r) => setTimeout(r, 400 * (attempt + 1)));
|
||||
}
|
||||
return res.json();
|
||||
throw new Error(lastErr || "applyBatch failed");
|
||||
},
|
||||
|
||||
async startInstance(process_definition_id: string, business_subject?: string, signal?: AbortSignal) {
|
||||
|
||||
Reference in New Issue
Block a user