stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

Stagehand env set to "BROWSERBASE", but API key is undefined—defaults to LOCAL instead of throwing an error

Open valentindoering opened this issue 1 year ago • 3 comments

When the stagehand env is set to "BROWSERBASE" in the constructor without a undefined API key, Stagehand defaults to "LOCAL" instead of issuing an error or warning.

valentindoering avatar Mar 17 '25 03:03 valentindoering

Thanks for the feedback! PRs welcome here :)

kamath avatar Mar 19 '25 18:03 kamath

It looks like in stagehand.init() at this point L674 this.env is modified to LOCAL as in L621 because the API key is undefined, which in turn makes L80-L81 ineffective as env is LOCAL at the time of matching those conditions.

The solution for this would be passing the intEnv variable to getBrowser and matching intEnv instead of env at L80-L81 .

yash1744 avatar Apr 02 '25 03:04 yash1744

Looks like this was already resolved — nice work!

I had been working on a fix as well but just saw the PR now. All good on my end, just flagging this so the issue can be closed if everything’s now in place

omlahore avatar Apr 06 '25 18:04 omlahore