Skip to content

Commit 4890f73

Browse files
wangczclaude
andcommitted
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). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b8c3fbe commit 4890f73

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)