From 1f0f728c63a4d9f32fc183c6a41627eedb8d1fe2 Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Fri, 9 Oct 2026 20:00:35 -0700 Subject: [PATCH] perf(hopper): stop repeating Hopper replies as raw_result (#1405) HopperProvider passed the bridge reply as rawResult and, for every operation except address_to_file_offset, the same object as the result. Every Hopper Evidence record (decompilation, procedure and string listings, xrefs, ...) therefore carried its complete result twice, and an MCP response four times counting its text copy. raw_result is now null unless REA transformed the reply, which only the file-offset mapping does; that case keeps Hopper's original reply. Co-authored-by: Claude Opus 5.5 --- src/hopper/HopperProvider.ts | 3 ++- tests/acceptance/applications/runtime.test.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hopper/HopperProvider.ts b/src/hopper/HopperProvider.ts index 5b1da0ba9..6c314ddb6 100644 --- a/src/hopper/HopperProvider.ts +++ b/src/hopper/HopperProvider.ts @@ -249,7 +249,8 @@ export class HopperProvider implements AnalysisProviderCandidate { ? { ok: true, value: createAnalysisExecution(mapped.value, executionProvider, { - rawResult: result.value, + // Only the file-offset mapping differs from Hopper's reply. + rawResult: mapped === result ? null : result.value, ...(profile === undefined ? {} : { analysisProfile: profile }), limitations: [ ...(preparedImage === undefined diff --git a/tests/acceptance/applications/runtime.test.ts b/tests/acceptance/applications/runtime.test.ts index 1a50c3fc1..bfa75b721 100644 --- a/tests/acceptance/applications/runtime.test.ts +++ b/tests/acceptance/applications/runtime.test.ts @@ -144,6 +144,8 @@ describe("production stdio runtime", () => { expect(evidence.operation).toBe("current_document"); expect(evidence.provider.id).toBe("hopper"); expect(evidence.normalized_result).toBe(observation.normalized_result); + // Hopper's reply is the result; it is not repeated as raw_result. + expect(evidence.raw_result).toBeNull(); expect(records).toContainEqual( expect.objectContaining({ application: "rea",