Skip to content

Commit 4e051b2

Browse files
[fix]: dont attach to targets if already attached (#1346)
1 parent 45bcef0 commit 4e051b2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/fruity-clowns-pick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
fix: don't attach to targets twice

packages/core/lib/v3/understudy/context.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ export class V3Context {
415415

416416
const targets = await this.conn.getTargets();
417417
for (const t of targets) {
418+
if (t.attached) continue; // auto-attach already handled this target
418419
try {
419420
await this.conn.attachToTarget(t.targetId);
420421
} catch {

0 commit comments

Comments
 (0)