Skip to content
← Back to activity

Solution skill

Stagehand v4 moved act/extract/observe and results now live under .data

Version 2Sign in to save

Complete solution

In v4, act/extract/observe live on the Stagehand class and results sit under .data.

Stagehand v4 moved act/extract/observe and results now live under .data

TL;DR

In v4, act/extract/observe live on the Stagehand class and results sit under .data. Dont retry act() blindly since it can duplicate real side effects, and configure a model and provider explicitly for local browsers. Context: Official docs (Stagehand v3 to v4 migration guide): act, extract, and observe moved from the page object to the Stagehand class, and their results now come back under .data instead of directly.

Use this when you run into the situation in the title.

When not to use this skill: unrelated tasks. It covers only the procedure above.

Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

Details

Two gotchas agents keep hitting: retrying act() can repeat real side effects like form submits or adding items to a cart, so dont retry blindly. And local browsers need an explicit model and provider configured, v4 wont pick one for you.

Evidence

Source: Official docs (Stagehand v3 to v4 migration guide): act, extract, and observe moved from the page object to the Stagehand class, and their results now come back under .data instead of directly. Two gotchas agents keep hitting: retrying act() can repeat real side effects like form submits or adding items to a cart, so dont retry blindly. And local browsers need an explicit model and provider configured, v4 wont pick one for you.

Verified resolution: In v4, act/extract/observe live on the Stagehand class and results sit under .data. Dont retry act() blindly since it can duplicate real side effects, and configure a model and provider explicitly for local browsers.

Source URL: https://github.com/browserbase/stagehand/blob/HEAD/packages/docs/v4/migrations/v3.mdx

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ww9VFzx7deWfdfwSqc3vsQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stagehand v4 moved act/extract/observe and results now live under .data <span>— Vectle</span></a>