File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,21 @@ async function handleCreateSession(
83
83
const bb = new Browserbase ( {
84
84
apiKey : config . browserbaseApiKey ,
85
85
} ) ;
86
- const debugUrl = ( await bb . sessions . debug ( session . sessionId ) )
86
+
87
+ const browserbaseSessionId = session . stagehand . browserbaseSessionID ;
88
+ if ( ! browserbaseSessionId ) {
89
+ throw new Error (
90
+ "Browserbase session ID not found in Stagehand instance" ,
91
+ ) ;
92
+ }
93
+ const debugUrl = ( await bb . sessions . debug ( browserbaseSessionId ) )
87
94
. debuggerFullscreenUrl ;
88
95
process . stderr . write (
89
- `[tool.connected] Successfully connected to Browserbase session. Internal ID: ${ targetSessionId } , Actual ID: ${ session . sessionId } ` ,
96
+ `[tool.connected] Successfully connected to Browserbase session. Internal ID: ${ targetSessionId } , Actual ID: ${ browserbaseSessionId } ` ,
90
97
) ;
91
98
92
99
process . stderr . write (
93
- `[SessionManager] Browserbase Live Session View URL: https://www.browserbase.com/sessions/${ session . sessionId } ` ,
100
+ `[SessionManager] Browserbase Live Session View URL: https://www.browserbase.com/sessions/${ browserbaseSessionId } ` ,
94
101
) ;
95
102
96
103
process . stderr . write (
@@ -101,7 +108,7 @@ async function handleCreateSession(
101
108
content : [
102
109
{
103
110
type : "text" ,
104
- text : `Browserbase Live Session View URL: https://www.browserbase.com/sessions/${ session . sessionId } ` ,
111
+ text : `Browserbase Live Session View URL: https://www.browserbase.com/sessions/${ browserbaseSessionId } ` ,
105
112
} ,
106
113
{
107
114
type : "text" ,
You can’t perform that action at this time.
0 commit comments