Skip to content

Commit d66c8e0

Browse files
author
wangcz
committed
fix: add capability check to perf daemon handler
The perf handler was missing an isCommandSupportedOnDevice check, so it returned empty metrics instead of UNSUPPORTED_OPERATION for platforms where perf is not supported (e.g. harmonyos).
1 parent b55838b commit d66c8e0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/daemon/handlers/session-observability.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ async function handlePerfCommand(params: ObservabilityParams): Promise<DaemonRes
7474
if (!session) {
7575
return errorResponse('SESSION_NOT_FOUND', 'perf requires an active session. Run open first.');
7676
}
77+
if (!isCommandSupportedOnDevice('perf', session.device)) {
78+
return errorResponse('UNSUPPORTED_OPERATION', 'perf is not supported on this device');
79+
}
7780

7881
try {
7982
return {

0 commit comments

Comments
 (0)