Skip to content

Commit e3b2dff

Browse files
committed
Fix TypeScript batch key payload modifiers.
This remaps normalized modifier keys to the Kernel API's `hold_keys` field so browser navigation helpers keep sending Ctrl/Alt chords correctly. Made-with: Cursor
1 parent 5c70593 commit e3b2dff

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

pkg/templates/typescript/openai-computer-use/lib/kernel-computer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,14 @@ function isBatchComputerActionType(actionType: string): boolean {
260260
}
261261

262262
function pressKeyAction(keys: string[], holdKeys?: string[]): BatchAction {
263-
return { type: 'press_key', press_key: normalizeKeypressPayload(keys, holdKeys) };
263+
const normalized = normalizeKeypressPayload(keys, holdKeys);
264+
return {
265+
type: 'press_key',
266+
press_key: {
267+
keys: normalized.keys,
268+
...(normalized.holdKeys.length > 0 ? { hold_keys: normalized.holdKeys } : {}),
269+
},
270+
};
264271
}
265272

266273
function gotoBatchActions(url: string): BatchAction[] {

0 commit comments

Comments
 (0)