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/outrageous-adept-hyena.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stagehand": patch
---

Fix draw_overlay on env:LOCAL
5 changes: 4 additions & 1 deletion stagehand/handlers/observe_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ async def observe(

# Draw overlay if requested
if options.draw_overlay:
await draw_observe_overlay(self.stagehand_page, elements_with_selectors)
await draw_observe_overlay(
page=self.stagehand_page,
elements=[el.model_dump() for el in elements_with_selectors],
)

# Return the list of results without trying to attach _llm_response
return elements_with_selectors
Expand Down
2 changes: 1 addition & 1 deletion stagehand/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def format_simplified_tree(node: AccessibilityNode, level: int = 0) -> str:
return result


async def draw_observe_overlay(page, elements):
async def draw_observe_overlay(page, elements: list[dict]):
"""
Draw an overlay on the page highlighting the observed elements.

Expand Down