Fix: check command hangs indefinitely (#272)

Fixes #257
This commit is contained in:
Chris Tate
2026-01-25 23:58:53 -06:00
committed by GitHub
parent 45506fbff0
commit a99f59cd20
3 changed files with 10 additions and 0 deletions
+8
View File
@@ -177,6 +177,14 @@ export function toAIFriendlyError(error: unknown, selector: string): Error {
);
}
// Handle general timeout (element exists but action couldn't complete)
if (message.includes('Timeout') && message.includes('exceeded')) {
return new Error(
`Action on "${selector}" timed out. The element may be blocked, still loading, or not interactable. ` +
`Run 'snapshot' to check the current page state.`
);
}
// Handle element not found (timeout waiting for element)
if (
message.includes('waiting for') &&
+1
View File
@@ -402,6 +402,7 @@ describe('BrowserManager', () => {
{ url: () => 'http://anothersite.com', on: vi.fn() },
],
on: vi.fn(),
setDefaultTimeout: vi.fn(),
},
],
close: vi.fn(),
+1
View File
@@ -1029,6 +1029,7 @@ export class BrowserManager {
this.cdpEndpoint = cdpEndpoint;
for (const context of contexts) {
context.setDefaultTimeout(10000);
this.contexts.push(context);
this.setupContextTracking(context);
}