Fail fast on unpainted browser screenshots

This commit is contained in:
Mohamed Boudra
2026-07-02 18:43:54 +02:00
parent 3eed8c31a2
commit adc0c01782
6 changed files with 265 additions and 11 deletions
@@ -374,6 +374,30 @@ describe("browser automation execute RPC schemas", () => {
height: 50,
},
});
expect(
BrowserAutomationExecuteResponseSchema.parse({
type: "browser.automation.execute.response",
payload: {
requestId: "req-shot-no-frame",
ok: false,
error: {
code: "screenshot_no_frame",
message:
"The browser tab has no painted frame. Focus the tab in the app, then try again.",
retryable: false,
},
},
}).payload,
).toEqual({
requestId: "req-shot-no-frame",
ok: false,
error: {
code: "screenshot_no_frame",
message: "The browser tab has no painted frame. Focus the tab in the app, then try again.",
retryable: false,
},
});
});
test("parses form control commands and responses", () => {
@@ -7,6 +7,7 @@ export const BrowserAutomationErrorCodeSchema = z.enum([
"browser_tab_not_found",
"browser_tab_closed",
"browser_timeout",
"screenshot_no_frame",
"browser_denied",
"browser_unsupported",
"browser_stale_ref",