Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tasty-candles-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand": patch
---

Improve failed act error logs
10 changes: 8 additions & 2 deletions lib/handlers/actHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class StagehandActHandler {
if (observeResults.length === 0) {
return {
success: false,
message: `Failed to self heal act: No observe results found for action`,
message: `Failed to self heal act: Element not found.`,
action: actCommand,
};
}
Expand Down Expand Up @@ -264,9 +264,15 @@ export class StagehandActHandler {
});

if (observeResults.length === 0) {
this.logger({
category: "action",
message:
"No elements found to act on. Check best practices for act: https://docs.stagehand.com/basics/act",
level: 2,
});
return {
success: false,
message: `Failed to perform act: No observe results found for action`,
message: `Failed to perform act: No elements found to act on.`,
action,
};
}
Expand Down