Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ test('Computer Use snapshots execution args and persists only the approval summa
const invocations: ToolInvocationRecord[] = [];
const observedImplArgs: unknown[] = [];
const observedSandboxArgs: unknown[] = [];
const observedPermissionContexts: unknown[] = [];
let release!: () => void;
const gate = new Promise<void>((resolve) => { release = resolve; });
const runtime = new ToolRuntime({
Expand All @@ -36,6 +37,14 @@ test('Computer Use snapshots execution args and persists only the approval summa
parameters: {},
categoryHint: 'computer_use',
permissionRequired: true,
permissionArgs: (permissionInput, permissionContext) => {
observedPermissionContexts.push(permissionContext);
return {
...(permissionInput as Record<string, unknown>),
app: 'Runtime Target',
window_id: 42,
};
},
sandbox: ({ args: sandboxArgs }) => {
observedSandboxArgs.push(sandboxArgs);
return { platformSandboxAvailable: true };
Expand Down Expand Up @@ -81,11 +90,17 @@ test('Computer Use snapshots execution args and persists only the approval summa
text: 'secret text',
coordinate: [123, 456],
}]);
assert.deepEqual(observedPermissionContexts, [{
sessionId: 'session-1',
turnId: 'turn-1',
toolCallId: 'tool-1',
}]);
const expectedSummary = {
action: 'type',
approvalClass: 'keyboard_mutation',
rememberForTurnAllowed: true,
app: 'Example',
app: 'Runtime Target',
windowId: 42,
observationId: 'frame-1',
};
const call = messages.find((message) => message.type === 'tool_call');
Expand Down
Loading
Loading