File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @browserbasehq/stagehand " : patch
3+ ---
4+
5+ update cua agents key & system prompt handling
Original file line number Diff line number Diff line change @@ -203,14 +203,16 @@ export class GoogleCUAClient extends AgentClient {
203203 // Note: The Python implementation doesn't include the initial screenshot
204204 // Following the same pattern here
205205
206+ const systemPromptContent = this . userProvidedInstructions
207+ ? this . userProvidedInstructions
208+ : buildGoogleCUASystemPrompt ( ) . content ;
209+
206210 this . history = [
207211 {
208212 role : "user" ,
209213 parts : [
210214 {
211- text :
212- "System prompt: " +
213- ( buildGoogleCUASystemPrompt ( ) . content as string ) ,
215+ text : "System prompt: " + systemPromptContent ,
214216 } ,
215217 ] ,
216218 } ,
Original file line number Diff line number Diff line change @@ -271,7 +271,10 @@ export class CuaAgentHandler {
271271 case "keypress" : {
272272 const { keys } = action ;
273273 if ( Array . isArray ( keys ) ) {
274- await this . page . keyboard . press ( keys . join ( "+" ) ) ;
274+ const mappedKeys = keys . map ( ( key ) =>
275+ mapKeyToPlaywright ( String ( key ) ) ,
276+ ) ;
277+ await this . page . keyboard . press ( mappedKeys . join ( "+" ) ) ;
275278 }
276279 return { success : true } ;
277280 }
You can’t perform that action at this time.
0 commit comments