Skip to content

Commit 69404e7

Browse files
committed
fix no-op screenshot logging in v3cua
1 parent 35798ab commit 69404e7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/core/lib/v3/handlers/v3CuaAgentHandler.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,20 @@ export class V3CuaAgentHandler {
7474
}
7575
}
7676
await new Promise((r) => setTimeout(r, 300));
77-
SessionFileLogger.logUnderstudyActionEvent({
78-
actionType: `v3CUA.${action.type}`,
79-
target: this.computePointerTarget(action),
80-
args: [action],
81-
});
77+
// Skip logging for screenshot actions - they're no-ops, the actual
78+
// Page.screenshot in captureAndSendScreenshot() is logged separately
79+
const shouldLog = action.type !== "screenshot";
80+
if (shouldLog) {
81+
SessionFileLogger.logUnderstudyActionEvent({
82+
actionType: `v3CUA.${action.type}`,
83+
target: this.computePointerTarget(action),
84+
args: [action],
85+
});
86+
}
8287
try {
8388
await this.executeAction(action);
8489
} finally {
85-
SessionFileLogger.logUnderstudyActionCompleted();
90+
if (shouldLog) SessionFileLogger.logUnderstudyActionCompleted();
8691
}
8792

8893
action.timestamp = Date.now();
@@ -381,7 +386,7 @@ export class V3CuaAgentHandler {
381386
return { success: true };
382387
}
383388
case "screenshot": {
384-
// Already handled around actions
389+
// No-op - screenshot is captured by captureAndSendScreenshot() after all actions
385390
return { success: true };
386391
}
387392
case "goto": {

0 commit comments

Comments
 (0)