mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-13 07:40:18 +00:00
Persist error/interrupt markers in history; add Retry on failed turns
Engine appends a display-only notice message on error/interrupted; providers never see it. New retry frame re-runs a failed turn with no new user message, guarded on the error tail. GUI renders persisted notices on reload and a Retry button on the trailing error.
This commit is contained in:
@@ -646,6 +646,12 @@ export async function mockApi(page: import("@playwright/test").Page) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
// A turn that dies on a provider error; the follow-up {type:"retry"} recovers.
|
||||
if (/fail the turn/i.test(msg.text)) {
|
||||
send("error", { error: "model unreachable" });
|
||||
send("turn_done");
|
||||
return;
|
||||
}
|
||||
// A deliberately SLOW multi-second stream (~40 ticks × 120ms) so specs can
|
||||
// interact mid-turn — the follow/pin scroll contract (FB-004) is untestable
|
||||
// against the instant echo below.
|
||||
@@ -697,6 +703,11 @@ export async function mockApi(page: import("@playwright/test").Page) {
|
||||
}
|
||||
send("interrupted", {});
|
||||
send("turn_done");
|
||||
} else if (msg.type === "retry") {
|
||||
// Like the real engine: re-runs with NO new user message (turn_start input is empty).
|
||||
send("turn_start", { input: "" });
|
||||
send("assistant_message", { text: "Recovered after retry." });
|
||||
send("turn_done");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user