feat(dogfood-wave1): Studio retries, Chat error, LLM gateway, kill snapshot, topbar cleanup (#14)
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled

This commit was merged in pull request #14.
This commit is contained in:
2026-06-15 14:30:04 +00:00
parent 601429ea89
commit d5a9c81b9c
17 changed files with 513 additions and 185 deletions
+15 -9
View File
@@ -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) {