Skip to content

Commit d3aa47e

Browse files
committed
fix(computer-use): keep JSON-encoded action names so custom actions stay exact
1 parent d9e91f8 commit d3aa47e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/sim/lib/mothership/tools/client/computer-tool-result.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function nodeRow(
6363
if (node.focused) fields.push('focused')
6464
if (node.editable) fields.push('editable')
6565
if (node.enabled === false) fields.push('disabled')
66-
if (node.actions.length) fields.push(`actions=${node.actions.slice(0, 16).join(',')}`)
66+
if (node.actions.length) fields.push(`actions=${JSON.stringify(node.actions.slice(0, 16))}`)
6767
if (node.windowId && node.windowId !== selectedWindowId) fields.push(`window=${node.windowId}`)
6868
if (
6969
node.x !== undefined &&
@@ -98,7 +98,7 @@ function snapshotForModel(result: ComputerUseSnapshot, envelopeBytes = 0) {
9898
windows,
9999
omittedWindowCount: allWindows.length - windows.length,
100100
treeFormat:
101-
'Rows: elementId role [parent=id] [label|value|placeholder] [focused] [editable] [disabled] [actions=...] [window=id, omitted for windowId] [screenRect=x,y,w,h in global points]. Empty layout groups are folded into their parent.',
101+
'Rows: elementId role [parent=id] [label|value|placeholder] [focused] [editable] [disabled] [actions=JSON array of exact names] [window=id, omitted for windowId] [screenRect=x,y,w,h in global points]. Empty layout groups are folded into their parent.',
102102
accessibilityTree: '',
103103
omittedNodeCount: nodes.filter((node) => !isWrapper(node)).length,
104104
nodeTextLimit: 512,

0 commit comments

Comments
 (0)