Skip to content

add history primitive #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sameelarif
Copy link
Member

why

We should expose a history of actions taken by Stagehand

what changed

Added a history key to the Stagehand object which stores an array of act, extract, observe, and goto calls. Since the history is stored on the StagehandPage level, this will capture events even if called by the operator agent.

test plan

Added a history.ts test to combination evals.

Copy link

changeset-bot bot commented Mar 20, 2025

🦋 Changeset detected

Latest commit: 69f4b18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sameelarif sameelarif added the combination These changes affect multiple Stagehand functions label Mar 20, 2025
@sameelarif sameelarif requested a review from kamath March 20, 2025 18:44
@sameelarif sameelarif merged commit 11e015d into main Mar 20, 2025
10 checks passed
@github-actions github-actions bot mentioned this pull request Mar 20, 2025
kamath pushed a commit that referenced this pull request Mar 25, 2025
* expose history

* add eval

* changeset

* handle history call on uninitialized page

* export history entry type

* add extract with no args to history

---------

Co-authored-by: Sean McGuire <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
combination These changes affect multiple Stagehand functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants