Skip to content

Commit e175217

Browse files
committed
Fix pressKeyAction hold_keys payload mapping
1 parent ff8d0c1 commit e175217

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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)