Skip to content

Commit 3264091

Browse files
committed
fix: add blockedMessage to guard result, emit header in screenshot fallback
- Add blockedMessage string to GuardResult so all 10 UI automation tools can correctly check and emit the guard message via statusLine - Emit headerEvent and statusLine in the screenshot optimization-failure base64 path for consistent client responses
1 parent 81e75be commit 3264091

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/mcp/tools/ui-automation/screenshot.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ export async function screenshotLogic(
276276
log('warn', `${LOG_PREFIX}/screenshot: Failed to delete temp file: ${err}`);
277277
}
278278

279+
ctx.emit(headerEvent);
280+
ctx.emit(statusLine('success', 'Screenshot captured'));
281+
ctx.emit(
282+
detailTree([{ label: 'Format', value: 'image/png (optimization failed)' }]),
283+
);
279284
ctx.attach({ data: base64Image, mimeType: 'image/png' });
280285
return;
281286
}

src/utils/debugger/ui-automation-guard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { DebuggerManager } from './debugger-manager.ts';
77

88
type GuardResult = {
99
blockedResponse?: ToolResponse;
10+
blockedMessage?: string;
1011
warningText?: string;
1112
};
1213

@@ -55,6 +56,7 @@ export async function guardUiAutomationAgainstStoppedDebugger(opts: {
5556
'UI automation blocked: app is paused in debugger',
5657
details,
5758
),
59+
blockedMessage: `UI automation blocked: app is paused in debugger\n${details}`,
5860
};
5961
}
6062

0 commit comments

Comments
 (0)